parent
f41f738621
commit
fb2243c3b1
@ -0,0 +1,68 @@
|
||||
/* ——————————————————————————————————————————————————————————————————————————
|
||||
Proyecto FWS
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
Fichero extractor.go
|
||||
Package errs
|
||||
Autor Juan V. Navarro juanvnl@activething.com
|
||||
Creado 24/01/2026
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
|
||||
LICENSES AND TERMS OF USE
|
||||
-------------------------
|
||||
|
||||
This software is licensed under the Elastic License v2.0 (the "License").
|
||||
For full terms and additional information regarding permitted and prohibited
|
||||
uses, please visit:
|
||||
https://activething.com/ATGO/licenses
|
||||
|
||||
You may use, copy, modify, and redistribute this software internally within
|
||||
your organization for any purpose, including research, development, and
|
||||
testing, subject to the terms of this License.
|
||||
|
||||
You may NOT, however, use, provide, distribute, or make this software
|
||||
available to any third party as part of a hosted service, SaaS offering, or
|
||||
commercial product without first obtaining a commercial license from
|
||||
Active Thing.
|
||||
|
||||
You may combine this software with other code, provided that such
|
||||
combination does not circumvent the restrictions of this License.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. In no event shall
|
||||
the authors or copyright holders be liable for any claim, damages, or other
|
||||
liability arising from the use of this software.
|
||||
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
|
||||
Web : activething.com | activething.com/FWS
|
||||
git : g.activething.com | github.com/activething/FWS
|
||||
Correo : dev@activething.com
|
||||
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
No deseo caminar sobre el agua", dijo Siddhartha.
|
||||
Que los antiguos chamanes se contenten con tales habilidades.
|
||||
—— Hermann Hesse, Siddhartha
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
Copyright (c) 2026 Active Thing
|
||||
————————————————————————————————————————————————————————————————————————————— */
|
||||
|
||||
package errs
|
||||
|
||||
|
||||
|
||||
type (
|
||||
|
||||
Extractor interface {
|
||||
Extract (err error, collector Collector)
|
||||
}
|
||||
|
||||
ExtractFnc func(err error, collector Collector)
|
||||
)
|
||||
|
||||
|
||||
func (f ExtractFnc) Extract(err error, collector Collector) { f(err, collector) }
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
/* ——————————————————————————————————————————————————————————————————————————
|
||||
Proyecto FWS
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
Fichero Extractors.go
|
||||
Package errs
|
||||
Autor Juan V. Navarro juanvnl@activething.com
|
||||
Creado 24/01/2026
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
|
||||
LICENSES AND TERMS OF USE
|
||||
-------------------------
|
||||
|
||||
This software is licensed under the Elastic License v2.0 (the "License").
|
||||
For full terms and additional information regarding permitted and prohibited
|
||||
uses, please visit:
|
||||
https://activething.com/ATGO/licenses
|
||||
|
||||
You may use, copy, modify, and redistribute this software internally within
|
||||
your organization for any purpose, including research, development, and
|
||||
testing, subject to the terms of this License.
|
||||
|
||||
You may NOT, however, use, provide, distribute, or make this software
|
||||
available to any third party as part of a hosted service, SaaS offering, or
|
||||
commercial product without first obtaining a commercial license from
|
||||
Active Thing.
|
||||
|
||||
You may combine this software with other code, provided that such
|
||||
combination does not circumvent the restrictions of this License.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. In no event shall
|
||||
the authors or copyright holders be liable for any claim, damages, or other
|
||||
liability arising from the use of this software.
|
||||
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
|
||||
Web : activething.com | activething.com/FWS
|
||||
git : g.activething.com | github.com/activething/FWS
|
||||
Correo : dev@activething.com
|
||||
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
No deseo caminar sobre el agua", dijo Siddhartha.
|
||||
Que los antiguos chamanes se contenten con tales habilidades.
|
||||
—— Hermann Hesse, Siddhartha
|
||||
—————————————————————————————————————————————————————————————————————————————
|
||||
Copyright (c) 2026 Active Thing
|
||||
————————————————————————————————————————————————————————————————————————————— */
|
||||
|
||||
package errs
|
||||
|
||||
import "sync"
|
||||
|
||||
type Extractors struct {
|
||||
rw sync.RWMutex
|
||||
extractors []Extractor
|
||||
}
|
||||
|
||||
|
||||
|
||||
func NewExtractors() *Extractors { return &Extractors{} }
|
||||
|
||||
|
||||
func (e *Extractors) AddExtractors(extractors ... Extractor) {
|
||||
if len(extractors) == 0 { return }
|
||||
e.rw.Lock(); defer e.rw.Unlock()
|
||||
for _,x := range extractors {
|
||||
if x != nil { e.extractors = append(e.extractors, x) }
|
||||
}
|
||||
}
|
||||
|
||||
func (e *Extractors) Extract (err error, collector Collector) {
|
||||
e.rw.RLock()
|
||||
defer e.rw.RUnlock()
|
||||
for _,x := range e.extractors { x.Extract(err,collector) }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in new issue