Documentation
¶
Index ¶
- Constants
- func Run(ctx context.Context, options ...Option) error
- func SetLogLevel(level log.Level)
- type Event
- type Flag
- type Option
- type Plugin
- type PluginStats
- type State
- func (state *State) Authorize(authorized bool)
- func (state *State) Establish(established bool)
- func (state *State) IsAuthorized() (authorized bool)
- func (state *State) IsAvailable() (available bool)
- func (state *State) IsEstablished() (established bool)
- func (state *State) IsSynchronized() (synchronized bool)
- func (state *State) Synchronize(synchronized bool)
- type UpgradeRequest
Constants ¶
View Source
const ( // UpgradeByImage represents upgrade chameleon service from image, works as new installation UpgradeByImage = iota + 1 // UpgradeByPatch allows upgrade partial components of chameleon service, such as chameleond and related plugins UpgradeByPatch )
View Source
const PluginStopAndRestart = "PluginStopAndRestart"
Variables ¶
This section is empty.
Functions ¶
func SetLogLevel ¶
Types ¶
type Event ¶
type Event = apis.MessageType
type Plugin ¶
type Plugin interface {
Name() string
Stats() PluginStats
SetStats(PluginStats)
IsActive() bool
IsEnabled() bool
SetEnabled(bool)
Version(ctx context.Context) (*apis.Version, error)
Start(ctx context.Context) error
Stop(ctx context.Context) error
Pause(ctx context.Context) error
Resume(ctx context.Context) error
Schedule(ctx context.Context, task *apis.Task) error
Unschedule(ctx context.Context, task *apis.Task) error
Notify(ctx context.Context, event *apis.Event) error
}
type PluginStats ¶
type PluginStats struct {
State apis.PluginState
Memory int64
CPU float64
Timestamp int64
}
func (PluginStats) Active ¶
func (stats PluginStats) Active() bool
func (PluginStats) Degraded ¶
func (stats PluginStats) Degraded() bool
func (PluginStats) Paused ¶
func (stats PluginStats) Paused() bool
func (PluginStats) Running ¶
func (stats PluginStats) Running() bool
func (PluginStats) Starting ¶
func (stats PluginStats) Starting() bool
func (PluginStats) Stopped ¶
func (stats PluginStats) Stopped() bool
func (PluginStats) Stopping ¶
func (stats PluginStats) Stopping() bool
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) IsAuthorized ¶
func (*State) IsAvailable ¶
func (*State) IsEstablished ¶
func (*State) IsSynchronized ¶
func (*State) Synchronize ¶
type UpgradeRequest ¶
type UpgradeRequest struct {
// UUID represents upgrade request task id
UUID string `json:"uuid"`
// Mode represents upgrade mode, UpgradeByImage or UpgradeByPatch
Mode int `json:"mode"`
// Artifact represents upgrade related assets.
// UpgradeByImage: Artifact can be tarball name or image name
// UpgradeByPatch: Artifact should be components upgrade package
Artifact string `json:"artifact"`
// Registry represents image registry authorize configure, if UpgradeByImage enabled and
// pull image from image registry
Registry *apis.Registry `json:"registry,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.