Documentation ¶
Index ¶
- Variables
- func ErrNoTeamMatchesID(id types.TeamID) error
- func ErrPartyAlreadyBelongsToTeam(referrer types.PartyID) error
- func ErrTeamIsClosed(id types.TeamID) error
- type Broker
- type Engine
- func (e *Engine) CreateTeam(ctx context.Context, referrer types.PartyID, deterministicTeamID types.TeamID, ...) error
- func (e *Engine) GetAllPartiesInTeams(minEpochsInTeam uint64) []string
- func (e *Engine) GetTeamMembers(team string, minEpochsInTeam uint64) []string
- func (e *Engine) IsTeamMember(party types.PartyID) bool
- func (e *Engine) JoinTeam(ctx context.Context, referee types.PartyID, ...) error
- func (e *Engine) OnEpoch(ctx context.Context, ep types.Epoch)
- func (e *Engine) OnEpochRestore(_ context.Context, ep types.Epoch)
- func (e *Engine) OnReferralProgramMinStakedVegaTokensUpdate(_ context.Context, value *num.Uint) error
- func (e *Engine) TeamExists(team types.TeamID) bool
- func (e *Engine) UpdateTeam(ctx context.Context, referrer types.PartyID, teamID types.TeamID, ...) error
- type EpochEngine
- type SnapshottedEngine
- func (e *SnapshottedEngine) GetState(k string) ([]byte, []types.StateProvider, error)
- func (e *SnapshottedEngine) Keys() []string
- func (e *SnapshottedEngine) LoadState(_ context.Context, p *types.Payload) ([]types.StateProvider, error)
- func (e *SnapshottedEngine) Namespace() types.SnapshotNamespace
- func (e *SnapshottedEngine) StopSnapshots()
- func (e *SnapshottedEngine) Stopped() bool
- type TimeService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOnlyReferrerCanUpdateTeam = errors.New("only the referrer can update the team properties") ErrReferrerCannotJoinAnotherTeam = errors.New("a referrer cannot join another team") ErrComputedTeamIDIsAlreadyInUse = errors.New("the computed team ID is already in use") ErrTeamNameIsAlreadyInUse = errors.New("the team name is already in use") )
Functions ¶
func ErrNoTeamMatchesID ¶
func ErrTeamIsClosed ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine(epochEngine EpochEngine, broker Broker, timeSvc TimeService) *Engine
func (*Engine) CreateTeam ¶
func (e *Engine) CreateTeam(ctx context.Context, referrer types.PartyID, deterministicTeamID types.TeamID, params *commandspb.CreateReferralSet_Team) error
func (*Engine) GetAllPartiesInTeams ¶
func (*Engine) GetTeamMembers ¶
func (*Engine) JoinTeam ¶
func (e *Engine) JoinTeam(ctx context.Context, referee types.PartyID, params *commandspb.ApplyReferralCode) error
func (*Engine) OnReferralProgramMinStakedVegaTokensUpdate ¶
func (*Engine) UpdateTeam ¶
func (e *Engine) UpdateTeam(ctx context.Context, referrer types.PartyID, teamID types.TeamID, params *commandspb.UpdateReferralSet_Team) error
type EpochEngine ¶
type EpochEngine interface {
NotifyOnEpoch(func(context.Context, types.Epoch), func(context.Context, types.Epoch))
}
EpochEngine is used to know when to apply the team switches.
type SnapshottedEngine ¶
type SnapshottedEngine struct { *Engine // contains filtered or unexported fields }
func NewSnapshottedEngine ¶
func NewSnapshottedEngine(epochEngine EpochEngine, broker Broker, timeSvc TimeService) *SnapshottedEngine
func (*SnapshottedEngine) GetState ¶
func (e *SnapshottedEngine) GetState(k string) ([]byte, []types.StateProvider, error)
func (*SnapshottedEngine) Keys ¶
func (e *SnapshottedEngine) Keys() []string
func (*SnapshottedEngine) LoadState ¶
func (e *SnapshottedEngine) LoadState(_ context.Context, p *types.Payload) ([]types.StateProvider, error)
func (*SnapshottedEngine) Namespace ¶
func (e *SnapshottedEngine) Namespace() types.SnapshotNamespace
func (*SnapshottedEngine) StopSnapshots ¶
func (e *SnapshottedEngine) StopSnapshots()
func (*SnapshottedEngine) Stopped ¶
func (e *SnapshottedEngine) Stopped() bool
type TimeService ¶
TimeService is used to retrieve the current chain time to time stamp the team and there membership.
Click to show internal directories.
Click to hide internal directories.