Documentation ¶
Index ¶
- Variables
- func ErrNoTeamMatchesID(id types.TeamID) error
- func ErrPartyAlreadyBelongsToTeam(referrer types.PartyID) 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) GetAllTeamsWithParties(minEpochsInTeam uint64) map[string][]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, params *commandspb.JoinTeam) 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 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 ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine(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) GetAllTeamsWithParties ¶
func (*Engine) GetTeamMembers ¶
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 SnapshottedEngine ¶
type SnapshottedEngine struct { *Engine // contains filtered or unexported fields }
func NewSnapshottedEngine ¶
func NewSnapshottedEngine(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.