evtypes

package
v0.1.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 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 (
	PassportRewardAge         = "age"
	PassportRewardNationality = "nationality"
)

Variables

This section is empty.

Functions

func FilterByFrequency

func FilterByFrequency(f Frequency) 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"`
	Disabled         bool       `fig:"disabled"`
	ActionURL        *url.URL   `fig:"action_url"`
}

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