gomesh

package module
v0.0.0-...-3adbeed Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: MIT Imports: 10 Imported by: 0

README

gomesh

service mesh build on injector library

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAgent = errors.New("agent implement not found")
)

errors

Functions

func LocalService

func LocalService(name string, F F)

LocalService register local service

func RegisterAgent

func RegisterAgent(agent Agent)

RegisterAgent .

func RegisterTccServer

func RegisterTccServer(server TccServer)

RegisterTccServer .

func RemoteService

func RemoteService(name string, F RemoteF)

RemoteService register remote service

func Start

func Start(config config.Config) error

Start start gomesh

Types

type Agent

type Agent interface {
	Start(config config.Config) error
	Config(name string) (config.Config, error)
	Listen() (net.Listener, error)
	Connect(name string, options ...grpc.DialOption) (*grpc.ClientConn, error)
}

Agent .

type F

type F func(config config.Config) (Service, error)

F service factory

type GrpcService

type GrpcService interface {
	Service
	GrpcHandle(server *grpc.Server) error
}

GrpcService export service to vist by grpc protocol

type Register

type Register interface {
	LocalService(name string, F F)
	RemoteService(name string, F RemoteF)
	Start(agent Agent, tccServer TccServer) error
}

Register .

func NewServiceRegister

func NewServiceRegister() Register

NewServiceRegister .

type RemoteF

type RemoteF func(conn *grpc.ClientConn) (Service, error)

RemoteF .

type RunnableService

type RunnableService interface {
	Start() error
}

RunnableService .

type Service

type Service interface {
}

Service service

type TccResource

type TccResource struct {
	GrpcRequireFullMethod string
	Commit                func(txid string) error
	Cancel                func(txid string) error
}

TccResource .

type TccServer

type TccServer interface {
	Start(config config.Config) error
	Register(tccResource TccResource) error
	NewTx(parentTxid string) (string, error)
	Commit(txid string) error
	Cancel(txid string) error
	BeforeRequire(ctx context.Context, GrpcRequireFullMethod string) error
	AfterRequire(ctx context.Context, GrpcRequireFullMethod string) error
}

TccServer .

func GetTccServer

func GetTccServer() TccServer

GetTccServer .

type TccService

type TccService interface {
	GrpcService
	TccHandle(server TccServer) error
}

TccService .

Directories

Path Synopsis
agent
basic
Package basic The basic agent implement
Package basic The basic agent implement

Jump to

Keyboard shortcuts

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