clients

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LeaderNotFoundError = fmt.Errorf("service leader not found")
)

Functions

This section is empty.

Types

type MetaConfig

type MetaConfig struct {
	GitInfoSHA string
	HBInterval int
	MetaAddr   *nebula.HostAddr // meta service address to connect
	AgentAddr  *nebula.HostAddr // info to be reported to the meta service
}

func NewMetaConfig

func NewMetaConfig(agentAddr, metaAddr, gitSHA string, hbInterval int) (*MetaConfig, error)

type NebulaMeta

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

NebulaMeta is the client to communicate with nebula meta servie, such as heartbeat\getMetaInfo. Through which, the agent could get services to monitor dynamically

func NewMeta

func NewMeta(config *MetaConfig) (*NebulaMeta, error)

type Service

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

Service keeps the metad/storaged/graphd's role name and root dir which should have scripts to start/stop service

func FromStartReq

func FromStartReq(req *pb.StartServiceRequest) *Service

func FromStatusReq added in v0.1.1

func FromStatusReq(req *pb.ServiceStatusRequest) *Service

func FromStopReq

func FromStopReq(req *pb.StopServiceRequest) *Service

type ServiceDaemon

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

ServiceDaemon will start/stop metad/storaged/graphd in the service machine through scripts providing by the nebula

func NewDaemon

func NewDaemon(s *Service) (*ServiceDaemon, error)

func (*ServiceDaemon) Start

func (d *ServiceDaemon) Start() error

TODO(spw): The code will only check the scripts return code. And when return code is 0, it does not mean the service has must been started successfully. Then we need to check the service process status by other means in the future

func (*ServiceDaemon) Status added in v0.1.1

func (d *ServiceDaemon) Status() (pb.Status, error)

func (*ServiceDaemon) Stop

func (d *ServiceDaemon) Stop() error

type ServiceName

type ServiceName string
const (
	ServiceName_Metad    ServiceName = "metad"
	ServiceName_Storaged ServiceName = "storaged"
	ServiceName_Graphd   ServiceName = "graphd"
	ServiceName_Unknown  ServiceName = "unknown"
)

type ServicePlayBack added in v0.2.0

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

func NewPlayBack added in v0.2.0

func NewPlayBack(req *pb.DataPlayBackRequest) *ServicePlayBack

func (*ServicePlayBack) PlayBack added in v0.2.0

func (p *ServicePlayBack) PlayBack() error

Jump to

Keyboard shortcuts

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