beats: github.com/elastic/beats/libbeat/common/reload Index | Files

package reload

import "github.com/elastic/beats/libbeat/common/reload"

Index

Package Files

reload.go

Variables

var Register = NewRegistry()

Register holds a registry of reloadable objects

type ConfigWithMeta Uses

type ConfigWithMeta struct {
    // Config to store
    Config *common.Config

    // Meta data related to this config
    Meta *common.MapStrPointer
}

ConfigWithMeta holds a pair of common.Config and optional metadata for it

type Registry Uses

type Registry struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

Registry of reloadable objects and lists

func NewRegistry Uses

func NewRegistry() *Registry

NewRegistry initializes and returns a reload registry

func (*Registry) GetRegisteredNames Uses

func (r *Registry) GetRegisteredNames() []string

GetRegisteredNames returns the list of names registered

func (*Registry) GetReloadable Uses

func (r *Registry) GetReloadable(name string) Reloadable

GetReloadable returns the reloadable object with the given name, nil if not found

func (*Registry) GetReloadableList Uses

func (r *Registry) GetReloadableList(name string) ReloadableList

GetReloadableList returns the reloadable list with the given name, nil if not found

func (*Registry) MustRegister Uses

func (r *Registry) MustRegister(name string, obj Reloadable)

MustRegister declares a reloadable object

func (*Registry) MustRegisterList Uses

func (r *Registry) MustRegisterList(name string, list ReloadableList)

MustRegisterList declares a reloadable object list

func (*Registry) Register Uses

func (r *Registry) Register(name string, obj Reloadable) error

Register declares a reloadable object

func (*Registry) RegisterList Uses

func (r *Registry) RegisterList(name string, list ReloadableList) error

RegisterList declares a reloadable list of configurations

type Reloadable Uses

type Reloadable interface {
    Reload(config *ConfigWithMeta) error
}

Reloadable provides a method to reload the configuration of an entity

type ReloadableFunc Uses

type ReloadableFunc func(config *ConfigWithMeta) error

ReloadableFunc wraps a custom function in order to implement the Reloadable interface.

func (ReloadableFunc) Reload Uses

func (fn ReloadableFunc) Reload(config *ConfigWithMeta) error

Reload calls the underlying function.

type ReloadableList Uses

type ReloadableList interface {
    Reload(configs []*ConfigWithMeta) error
}

ReloadableList provides a method to reload the configuration of a list of entities

Package reload imports 3 packages (graph) and is imported by 71 packages. Updated 2019-02-17. Refresh now. Tools for package owners.