ctlservice

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Address ctl service address
	Address address.Address `toml:"address"`
}

Config ctl service address

func (*Config) Adjust

func (c *Config) Adjust(machineHost, defaultListenAddress string)

Adjust adjust config, setup default configs

type CtlService

type CtlService interface {
	// AddHandleFunc add ctl message handler
	AddHandleFunc(method pb.CmdMethod, h func(context.Context, *pb.Request, *pb.Response) error, async bool)
	// SendCtlMessage send ctl message to a service
	SendCtlMessage(ctx context.Context, serviceType metadata.ServiceType, serviceID string, req *pb.Request) (*pb.Response, error)
	// NewRequest new a request by cmd method
	NewRequest(pb.CmdMethod) *pb.Request
	// Release release response
	Release(*pb.Response)
	// Start start ctl service
	Start() error
	// Close close the service
	Close() error
}

CtlService is used to send ctl request to another service or handle request from another service.

func GetCtlService

func GetCtlService() CtlService

GetCtlService get ctl cluster from process level runtime

func NewCtlService

func NewCtlService(
	serviceID string,
	address string,
	cfg morpc.Config) (CtlService, error)

NewCtlService new ctl service to send ctl message to another service or handle ctl request from other ctl service.

Jump to

Keyboard shortcuts

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