instance

package
v0.6.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2023 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSentryWriter

func NewSentryWriter(log *zap.Logger) sentryWriter

Types

type APIInstanceInfo

type APIInstanceInfo struct {
	Version   string `json:"version" required:"true"`
	BuildHash string `json:"buildHash" required:"true"`

	Dirs *extconfig.ExtConfigDirs `json:"dirs" required:"true"`

	CurrentInstanceIdentifier string `json:"currentInstanceIdentifier" required:"true"`
	CurrentInstanceIP         string `json:"currentInstanceIP" required:"true"`
}

type APIInstancesOutput

type APIInstancesOutput struct {
	Instances []InstanceInfo `json:"instances" required:"true"`
}

type APIRoleRestartInput added in v0.3.18

type APIRoleRestartInput struct {
	ID string `json:"roleId"`
}

type APIRoleRestartOutput added in v0.3.18

type APIRoleRestartOutput struct {
}

type ClusterInfo

type ClusterInfo struct {
	Setup bool `json:"setup"`
}

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func New

func New() *Instance

func (*Instance) APIClusterRoleRestart added in v0.3.18

func (i *Instance) APIClusterRoleRestart() usecase.Interactor

func (*Instance) APIInstanceInfo

func (i *Instance) APIInstanceInfo() usecase.Interactor

func (*Instance) APIInstances

func (i *Instance) APIInstances() usecase.Interactor

func (*Instance) DispatchEvent

func (i *Instance) DispatchEvent(topic string, ev *roles.Event)

func (*Instance) ForRole

func (i *Instance) ForRole(roleId string, ctx context.Context) *RoleInstance

func (*Instance) Log

func (i *Instance) Log() *zap.Logger

func (*Instance) Role

func (i *Instance) Role(id string) roles.Role

func (*Instance) Start

func (i *Instance) Start()

func (*Instance) Stop

func (i *Instance) Stop()

type InstanceInfo

type InstanceInfo struct {
	Version    string `json:"version" required:"true"`
	Roles      string `json:"roles" required:"true"`
	Identifier string `json:"identifier" required:"true"`
	IP         string `json:"ip" required:"true"`
}

type RoleContext

type RoleContext struct {
	Role              roles.Role
	RoleInstance      *RoleInstance
	ContextCancelFunc context.CancelFunc
}

type RoleInstance

type RoleInstance struct {
	// contains filtered or unexported fields
}

func (*RoleInstance) AddEventListener

func (ri *RoleInstance) AddEventListener(topic string, handler roles.EventHandler)

func (*RoleInstance) Context added in v0.4.9

func (ri *RoleInstance) Context() context.Context

func (*RoleInstance) DispatchEvent

func (ri *RoleInstance) DispatchEvent(topic string, ev *roles.Event)

func (*RoleInstance) KV

func (ri *RoleInstance) KV() *storage.Client

func (*RoleInstance) Log

func (ri *RoleInstance) Log() *zap.Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL