evtypes

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeGetPoH           = "get_poh"
	TypeFreeWeekly       = "free_weekly"
	TypeBeReferred       = "be_referred"
	TypeReferralSpecific = "referral_specific"
	TypePassportScan     = "passport_scan"
)
View Source
const (
	FlagActive     = "active"
	FlagNotStarted = "not_started"
	FlagExpired    = "expired"
	FlagDisabled   = "disabled"
)

Variables

This section is empty.

Functions

func FilterByFlags added in v0.2.1

func FilterByFlags(flags ...string) func(EventConfig) bool

func FilterByFrequency

func FilterByFrequency(f Frequency) func(EventConfig) bool

func FilterByNames added in v0.2.1

func FilterByNames(names ...string) func(EventConfig) bool

func FilterExpired

func FilterExpired(ev EventConfig) bool

func FilterInactive

func FilterInactive(ev EventConfig) bool

func FilterNotOpenable

func FilterNotOpenable(ev EventConfig) bool

func FilterNotStarted

func FilterNotStarted(ev EventConfig) bool

Types

type EventConfig

type EventConfig struct {
	Name             string     `fig:"name,required"`
	Description      string     `fig:"description,required"`
	ShortDescription string     `fig:"short_description,required"`
	Reward           int64      `fig:"reward,required"`
	Title            string     `fig:"title,required"`
	Frequency        Frequency  `fig:"frequency,required"`
	StartsAt         *time.Time `fig:"starts_at"`
	ExpiresAt        *time.Time `fig:"expires_at"`
	NoAutoOpen       bool       `fig:"no_auto_open"`
	AutoClaim        bool       `fig:"auto_claim"`
	Disabled         bool       `fig:"disabled"`
	ActionURL        *url.URL   `fig:"action_url"`
}

func (EventConfig) Flag added in v0.2.1

func (e EventConfig) Flag() string

func (EventConfig) Resource

func (e EventConfig) Resource() resources.EventStaticMeta

type EventTypeser

type EventTypeser interface {
	EventTypes() Types
}

func NewConfig

func NewConfig(getter kv.Getter) EventTypeser

type Frequency

type Frequency string
const (
	OneTime   Frequency = "one-time"
	Daily     Frequency = "daily"
	Weekly    Frequency = "weekly"
	Unlimited Frequency = "unlimited"
)

func (Frequency) String

func (f Frequency) String() string

type Types

type Types struct {
	// contains filtered or unexported fields
}

func (Types) Get

func (t Types) Get(name string, filters ...filter) *EventConfig

func (Types) List

func (t Types) List(filters ...filter) []EventConfig

func (Types) Names

func (t Types) Names(filters ...filter) []string

func (Types) PrepareEvents

func (t Types) PrepareEvents(nullifier string, filters ...filter) []data.Event

Jump to

Keyboard shortcuts

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