ctlservice

package
v1.0.0-rc2 Latest Latest
Warning

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

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

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