teams

package
v0.78.4 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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 ErrNoTeamMatchesID(id types.TeamID) error

func ErrPartyAlreadyBelongsToTeam

func ErrPartyAlreadyBelongsToTeam(referrer types.PartyID) error

Types

type Broker

type Broker interface {
	Send(event events.Event)
}

Broker is used to notify administrative actions on teams and members.

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 (e *Engine) GetAllPartiesInTeams(minEpochsInTeam uint64) []string

func (*Engine) GetAllTeamsWithParties

func (e *Engine) GetAllTeamsWithParties(minEpochsInTeam uint64) map[string][]string

func (*Engine) GetTeamMembers

func (e *Engine) GetTeamMembers(team string, minEpochsInTeam uint64) []string

func (*Engine) IsTeamMember

func (e *Engine) IsTeamMember(party types.PartyID) bool

func (*Engine) JoinTeam

func (e *Engine) JoinTeam(ctx context.Context, referee types.PartyID, params *commandspb.JoinTeam) error

func (*Engine) OnEpoch

func (e *Engine) OnEpoch(ctx context.Context, ep types.Epoch)

func (*Engine) OnEpochRestore

func (e *Engine) OnEpochRestore(_ context.Context, ep types.Epoch)

func (*Engine) OnReferralProgramMinStakedVegaTokensUpdate

func (e *Engine) OnReferralProgramMinStakedVegaTokensUpdate(_ context.Context, value *num.Uint) error

func (*Engine) TeamExists

func (e *Engine) TeamExists(team types.TeamID) bool

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 (*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

type TimeService interface {
	GetTimeNow() time.Time
}

TimeService is used to retrieve the current chain time to time stamp the team and there membership.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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