Documentation ¶
Index ¶
Constants ¶
View Source
const (
PINWE = 0x11BC
)
PINWE .
Variables ¶
View Source
var ( ErrServiceNotFound = errors.New("service not found") ErrNetworkClosed = errors.New("underground network closed") )
Builtin errors
View Source
var ( ProtocolServiceHub = "/dynamicgo/mesh/hub/1.0.0" ProtocolConfigService = "/dynamicgo/mesh/config/1.0.0" )
Builtin protocols
View Source
var (
ErrFormat = errors.New("invalid peer address format")
)
Errors
Functions ¶
func RegisterNetwork ¶
func RegisterNetwork(name string, network NetworkPlugin)
RegisterNetwork register network plugin
Types ¶
type Agent ¶
type Agent interface { Network() Network Stop() error RegisterService(name string, options ...grpc.ServerOption) (Service, error) FindService(name string, options ...grpc.DialOption) (*grpc.ClientConn, error) }
Agent microsrevice mesh agent node
type Dialer ¶
type Dialer interface { Dial(ctx context.Context, serviceName string, options ...grpc.DialOption) (*grpc.ClientConn, error) Network() Network }
Dialer .
type DialerBalancer ¶
DialerBalancer .
type Network ¶
type Network interface { Stop() error Listen(serviceName string) (net.Listener, error) Dial(peer *Peer, serviceName string, timeout time.Duration) (net.Conn, error) ID() string Peer() *Peer }
Network .
type NetworkPlugin ¶
NetworkPlugin .
type Peer ¶
Peer peer info struct
func ParseMeshAddr ¶
ParseMeshAddr parse mesh address to peer object
type Service ¶
type Service interface {
Run(main ServiceMain, options ...ServiceOption) error
}
Service .
type ServiceConfig ¶
ServiceConfig .
type ServiceMain ¶
ServiceMain service main entry
type ServiceOption ¶
type ServiceOption func(config *ServiceConfig)
ServiceOption .
func NoRemoteConfig ¶
func NoRemoteConfig() ServiceOption
NoRemoteConfig ignore load config from admin
func WithConfig ¶
func WithConfig(source source.Source) ServiceOption
WithConfig load service with input config ,multi WithConfig option will auto merged
Source Files ¶
Click to show internal directories.
Click to hide internal directories.