Versions in this module Expand all Collapse all v0 v0.0.1 Apr 21, 2023 Changes in this version + var DefaultOptions = &Options + var ErrEmpty = errors.New("The Group cannot be empty") + func BuildDirectTarget(uri string) string + func BuildDiscoveryTarget(uri string) string + func RegisterBalancerWithAlgorithm(name balancer.Algorithm) + func RegisterBuilder(discovery registry.Discovery) + type Branch struct + func NewBranch(uri string, action consts.BranchAction) *Branch + func (branch *Branch) Convert() *proto.RegisterReq_Branch + func (branch *Branch) SetData(data []byte) *Branch + func (branch *Branch) SetHeader(header []byte) *Branch + func (branch *Branch) SetLevel(level consts.Level) *Branch + func (branch *Branch) SetProtocol(protocol Protocol) *Branch + func (branch *Branch) SetTimeout(timeout int64) *Branch + type Client struct + func New(uri string, options ...Option) (client *Client, err error) + func (client *Client) Begin(ctx context.Context) (gid string, err error) + func (client *Client) Close(ctx context.Context) error + func (client *Client) Commit(ctx context.Context, gid string) error + func (client *Client) Register(ctx context.Context, gid string, groups []*Group) error + func (client *Client) Rollback(ctx context.Context, gid string) error + func (client *Client) Start(ctx context.Context, gid string) (err error) + type Group struct + func NewSagaGroup(normalUri, compensation string, opts ...GroupOpt) *Group + func NewTccGroup(tryUri, confirmUri, cancelUri string, opts ...GroupOpt) *Group + func (g *Group) GetTranType() consts.TransactionType + func (g *Group) SetData(data []byte) *Group + func (g *Group) SetHeader(data []byte) *Group + func (g *Group) SetLevel(level consts.Level) *Group + func (g *Group) SetTimeout(second int) *Group + type GroupOpt func(group *Group) + func LevelFixed() GroupOpt + type HandlerFn func(ctx context.Context) error + type Manger struct + func NewManger() *Manger + func (m *Manger) AddGroups(groups ...*Group) *Manger + func (m *Manger) AddNextWaitGroups(groups ...*Group) *Manger + func (m *Manger) Groups() []*Group + type Option func(options *Options) + func WithAfterFunc(after HandlerFn) Option + func WithBeforeFunc(before HandlerFn) Option + func WithConnTimeout(seconds time.Duration) Option + func WithDiscovery() Option + func WithGrpcDailOpts(opts []grpc.DialOption) Option + func WithTls(tls *tls.Config) Option + type Options struct + type Protocol string + const GRPC + const HTTP + const Undefined