Documentation ¶
Index ¶
Constants ¶
const DefaultRegistryFilename = "registry.json"
DefaultRegistryFilename is the default registry filename
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONRegistry ¶
type JSONRegistry struct { Version int Registry map[string]RegistryEntry }
JSONRegistry represents the registry that will be written on disk
type NullAuditor ¶ added in v0.9.0
type NullAuditor struct {
// contains filtered or unexported fields
}
NullAuditor is an auditor not doing anything with the message it received. It has been introduced for the Serverless Agent which doesn't need to maintain a registry.
func NewNullAuditor ¶ added in v0.9.0
func NewNullAuditor() *NullAuditor
NewNullAuditor returns an instanciated NullAuditor. `Start()` is the next method that should be used on this NullAuditor.
func (*NullAuditor) Channel ¶ added in v0.9.0
func (a *NullAuditor) Channel() chan *message.Message
Channel returns the channel on which should be sent the messages.
func (*NullAuditor) GetOffset ¶ added in v0.9.0
func (a *NullAuditor) GetOffset(identifier string) string
GetOffset returns an empty string.
func (*NullAuditor) GetTailingMode ¶ added in v0.9.0
func (a *NullAuditor) GetTailingMode(identifier string) string
GetTailingMode returns an empty string.
func (*NullAuditor) Start ¶ added in v0.9.0
func (a *NullAuditor) Start()
Start starts the NullAuditor main loop.
func (*NullAuditor) Stop ¶ added in v0.9.0
func (a *NullAuditor) Stop()
Stop stops the NullAuditor main loop.
type Registry ¶
type Registry interface { GetOffset(identifier string) string GetTailingMode(identifier string) string }
Registry holds a list of offsets.
type RegistryAuditor ¶ added in v0.9.0
type RegistryAuditor struct {
// contains filtered or unexported fields
}
A RegistryAuditor is storing the Auditor information using a registry.
func New ¶
func New(runPath string, filename string, ttl time.Duration, health *health.Handle) *RegistryAuditor
New returns an initialized Auditor
func (*RegistryAuditor) Channel ¶ added in v0.9.0
func (a *RegistryAuditor) Channel() chan *message.Message
Channel returns the channel to use to communicate with the auditor or nil if the auditor is currently stopped.
func (*RegistryAuditor) GetOffset ¶ added in v0.9.0
func (a *RegistryAuditor) GetOffset(identifier string) string
GetOffset returns the last committed offset for a given identifier, returns an empty string if it does not exist.
func (*RegistryAuditor) GetTailingMode ¶ added in v0.9.0
func (a *RegistryAuditor) GetTailingMode(identifier string) string
GetTailingMode returns the last committed offset for a given identifier, returns an empty string if it does not exist.
func (*RegistryAuditor) Start ¶ added in v0.9.0
func (a *RegistryAuditor) Start()
Start starts the Auditor
func (*RegistryAuditor) Stop ¶ added in v0.9.0
func (a *RegistryAuditor) Stop()
Stop stops the Auditor