Documentation
¶
Index ¶
- Constants
- func Locate(fields logrus.Fields) logrus.Fields
- type Config
- type DBMgr
- type EpochMgr
- type ExitStatus
- type Ketch
- func (k *Ketch) CreateResources(myType api.Type, list api.ResourceList) (api.ResourceList, error, int)
- func (k *Ketch) GetBroadcasts(overhead, limit int) [][]byte
- func (k *Ketch) GetResources(myType api.Type) api.ResourceList
- func (k *Ketch) GetUptime()
- func (k *Ketch) Join(list []string) (int, error)
- func (k *Ketch) LocalState(join bool) []byte
- func (k *Ketch) Members() []*memberlist.Node
- func (k *Ketch) MergeRemoteState(buf []byte, join bool)
- func (k *Ketch) NodeMeta(limit int) []byte
- func (k *Ketch) NotifyMsg(buf []byte)
- type ReplicaMgr
- type ResourceMgr
- func (m *ResourceMgr) ClearResources()
- func (m *ResourceMgr) CreateResources(list api.ResourceList) (api.ResourceList, error, int)
- func (m *ResourceMgr) GetResources() api.ResourceList
- func (m *ResourceMgr) Init(k *Ketch, instance ResourceMgrInstance)
- func (m *ResourceMgr) LoadResources()
- func (m *ResourceMgr) RefreshResources()
- type ResourceMgrInstance
- type ResourceMgrInterface
- type RuntimeMgr
- type ServerMgr
- type TimeVal
- type Utmp
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Logger to send logs to
Log *logrus.Logger
// ListConfig is the HashiCorp Memberlist configuration to use.
ListConfig *memberlist.Config
// DataDir is the directory to store all data for this instance of Ketch.
DataDir string
// DBBinDir is the directory for database executables.
DBBinDir string
}
Config Configuration for Ketch service.
type DBMgr ¶
type DBMgr struct {
ResourceMgr
}
func (*DBMgr) GetList ¶
func (m *DBMgr) GetList() api.ResourceList
type EpochMgr ¶
type EpochMgr struct {
ResourceMgr
}
func (*EpochMgr) GetList ¶
func (m *EpochMgr) GetList() api.ResourceList
type ExitStatus ¶
Structures for reading utmp
type Ketch ¶
type Ketch struct {
// Read/write lock to protect Ketch state
sync.RWMutex
// contains filtered or unexported fields
}
Ketch State of Ketch service.
func (*Ketch) CreateResources ¶
func (k *Ketch) CreateResources(myType api.Type, list api.ResourceList) (api.ResourceList, error, int)
CreateResources creates resources from a list. Returns the list created, error and http status
func (*Ketch) GetBroadcasts ¶
func (*Ketch) GetResources ¶
func (k *Ketch) GetResources(myType api.Type) api.ResourceList
GetResources returns list of resources.
func (*Ketch) GetUptime ¶
func (k *Ketch) GetUptime()
GetUptime sets uptime seconds since boot. We use this value for leases as it is monotonically increasing. On system restart all acceptor lease values are reset, compromising availability for safety.
func (*Ketch) Join ¶
Join Sync state with list of candidate Ketch members. Returns number of members successfully joined. Wrapper around Memberlist Join()
func (*Ketch) LocalState ¶
func (*Ketch) Members ¶
func (k *Ketch) Members() []*memberlist.Node
Members Return list of Ketch members. Wrapper around Memberlist Members()
func (*Ketch) MergeRemoteState ¶
type ReplicaMgr ¶
type ReplicaMgr struct {
ResourceMgr
}
func (*ReplicaMgr) GetList ¶
func (m *ReplicaMgr) GetList() api.ResourceList
func (*ReplicaMgr) InitResource ¶
func (m *ReplicaMgr) InitResource(in api.Resource) (error, int)
func (*ReplicaMgr) UpdateAfterLoad ¶
func (m *ReplicaMgr) UpdateAfterLoad(resource api.Resource) bool
type ResourceMgr ¶
type ResourceMgr struct {
// contains filtered or unexported fields
}
func (*ResourceMgr) ClearResources ¶
func (m *ResourceMgr) ClearResources()
ClearResources clears all resources of the specified type.
func (*ResourceMgr) CreateResources ¶
func (m *ResourceMgr) CreateResources(list api.ResourceList) (api.ResourceList, error, int)
CreateResources creates resources from a list. Returns the list created, error and http status
func (*ResourceMgr) GetResources ¶
func (m *ResourceMgr) GetResources() api.ResourceList
GetResources returns list of resources.
func (*ResourceMgr) Init ¶
func (m *ResourceMgr) Init(k *Ketch, instance ResourceMgrInstance)
Links up an instance of the resource manager
func (*ResourceMgr) LoadResources ¶
func (m *ResourceMgr) LoadResources()
LoadResources loads existing resources from database into Ketch. Called locked.
func (*ResourceMgr) RefreshResources ¶
func (m *ResourceMgr) RefreshResources()
RefreshResources calls resource specific getList() to refresh resources.
type ResourceMgrInstance ¶
type ResourceMgrInterface ¶
type ResourceMgrInterface interface {
Init(ketch Ketch, myType api.Type, instance ResourceMgrInstance)
RefreshResources()
GetResources() api.ResourceList
ClearResources()
CreateResources(list api.ResourceList) (api.ResourceList, error, int)
LoadResources()
}
type RuntimeMgr ¶
type RuntimeMgr struct {
ResourceMgr
}
func (*RuntimeMgr) GetList ¶
func (m *RuntimeMgr) GetList() api.ResourceList
func (*RuntimeMgr) InitResource ¶
func (m *RuntimeMgr) InitResource(in api.Resource) (error, int)
func (*RuntimeMgr) UpdateAfterLoad ¶
func (m *RuntimeMgr) UpdateAfterLoad(in api.Resource) bool
type ServerMgr ¶
type ServerMgr struct {
ResourceMgr
}
func (*ServerMgr) GetList ¶
func (m *ServerMgr) GetList() api.ResourceList
