Documentation ¶
Index ¶
- Variables
- func LocalService(name string, F F)
- func RegisterAgent(agent Agent)
- func RegisterTccServer(server TccServer)
- func RemoteService(name string, F RemoteF)
- func Start(config config.Config) error
- type Agent
- type F
- type GrpcService
- type Register
- type RemoteF
- type RunnableService
- type Service
- type TccResource
- type TccServer
- type TccService
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAgent = errors.New("agent implement not found")
)
errors
Functions ¶
func RemoteService ¶
RemoteService register remote service
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 GrpcService ¶
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 .
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 .
type TccService ¶
type TccService interface { GrpcService TccHandle(server TccServer) error }
TccService .
Click to show internal directories.
Click to hide internal directories.