utils

package
v0.0.0-...-4fa03f3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TicketSponsorNameLowerCase is the sponsors ticket type
	TicketSponsorNameLowerCase = "sponsors"
	//TicketSpeakerCescNameLowerCase is the cesc speakers ticket type
	TicketSpeakerCescNameLowerCase = "cesc speakers"
	//TicketSpeakerEpicenterNameLowerCase is the epicenter speakers ticket type
	TicketSpeakerEpicenterNameLowerCase = "epicenter speakers"
)
View Source
const (
	//EventbriteAuthEnvKey the key name for auth
	EventbriteAuthEnvKey = "EVENTBRITE_AUTH"
	//EventbriteEventEnvKey the event to operate on
	EventbriteEventEnvKey = "EVENTBRITE_EVENT"
	//EventbriteURL the eventbrite url for sfblock week
	EventbriteURL = "https://www.eventbriteapi.com/v3/events/%s/attendees?page=%d"

	//HeaderPrefix the prefix to the value for auth with eventbrite
	HeaderPrefix = "Bearer %s"
)

Variables

This section is empty.

Functions

func AddAttendeeToKeeper

func AddAttendeeToKeeper(ctx sdk.Context, keeper *longy.Keeper, badgeID string, claimed bool,
	sponsor bool) (attendee types.Attendee)

AddAttendeeToKeeper is a helper for adding an attendee and its associate account to a test keeper

func GetAttendees

func GetAttendees() (ga longy.GenesisAttendees, err sdk.Error)

GetAttendees gets the attendee list from eventbrite while using the auth key found in an environmental var

func SetServiceAccount

func SetServiceAccount(ctx sdk.Context, k longy.Keeper, addresses sdk.AccAddress) exported.Account

SetServiceAccount creates and sets an account to be the service

Types

type EventbriteAttendee

type EventbriteAttendee struct {
	ID              string            `json:"id"`
	TicketClassName string            `json:"ticket_class_name"`
	Profile         EventbriteProfile `json:"profile"` //gets the full info of the account
}

EventbriteAttendee is the attendee structure in the genesis file

func (*EventbriteAttendee) IsSponsorTicket

func (e *EventbriteAttendee) IsSponsorTicket() bool

IsSponsorTicket checks to see if the ticket type is of a speaker or sponsor that gets special point bonuses

func (*EventbriteAttendee) ToGenesisAttendee

func (e *EventbriteAttendee) ToGenesisAttendee() longy.Attendee

ToGenesisAttendee turns the eventbrite type to our local type

type EventbriteAttendees

type EventbriteAttendees []EventbriteAttendee

EventbriteAttendees is the array of attendees that the api returns for processing

type EventbriteData

type EventbriteData struct {
	PaginationInfo Pagination          `json:"pagination"`
	Attendees      EventbriteAttendees `json:"attendees"`
}

EventbriteData is the return data of a page call

type EventbriteProfile

type EventbriteProfile struct {
	Name     string `json:"name"`
	Company  string `json:"company"`
	Email    string `json:"email"`
	JobTitle string `json:"job_title"`
}

EventbriteProfile is the profile of the attendee from eventbrite

type Pagination

type Pagination struct {
	Count     int `json:"object_count"`
	Page      int `json:"page_number"`
	PageCount int `json:"page_count"`
}

Pagination is the pagination info of a page call

Jump to

Keyboard shortcuts

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