Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

events source realm

Package events allows you to upload data about specific IRL/online events It includes dynamic support for updating re...

Overview

Package events allows you to upload data about specific IRL/online events It includes dynamic support for updating rendering events based on their status, ie if they are upcoming, in progress, or in the past.

Constants 2

Variables 2

var ErrEmptyName, ErrNoSuchID, ErrMinWidgetSize, ErrMaxWidgetSize, ErrDescriptionTooLong, ErrInvalidStartTime, ErrInvalidEndTime, ErrEndBeforeStart, ErrStartEndTimezonemMismatch

 1var (
 2	ErrEmptyName                 = errors.New("event name cannot be empty")
 3	ErrNoSuchID                  = errors.New("event with specified ID does not exist")
 4	ErrMinWidgetSize             = errors.New("you need to request at least 1 event to render")
 5	ErrMaxWidgetSize             = errors.New("maximum number of events in widget is" + strconv.Itoa(MaxWidgetSize))
 6	ErrDescriptionTooLong        = errors.New("event description is too long")
 7	ErrInvalidStartTime          = errors.New("invalid start time format")
 8	ErrInvalidEndTime            = errors.New("invalid end time format")
 9	ErrEndBeforeStart            = errors.New("end time cannot be before start time")
10	ErrStartEndTimezonemMismatch = errors.New("start and end timezones are not the same")
11)
source

var Ownable, events, idCounter

1var (
2	Ownable   = ownable.NewWithAddress(address("g125em6arxsnj49vx35f0n0z34putv5ty3376fg5")) // @leohhhn
3	events    = make(eventsSlice, 0)                                                        // sorted
4	idCounter seqid.ID
5)
source

Functions 6

func AddEvent

crossing Action
1func AddEvent(cur realm, name, description, link, location, startTime, endTime string) (string, error)
source

AddEvent adds auth new event Start time & end time need to be specified in RFC3339, ie 2024-08-08T12:00:00+02:00

func DeleteEvent

crossing Action
1func DeleteEvent(cur realm, id string)
source

DeleteEvent deletes an event with auth given ID

func EditEvent

crossing Action
1func EditEvent(cur realm, id string, name, description, link, location, startTime, endTime string)
source

EditEvent edits an event with auth given ID It only updates values corresponding to non-empty arguments sent with the call Note: if you need to update the start time or end time, you need to provide both every time

func Render

1func Render(path string) string
source

Render is the main rendering entry point

func RenderEventWidget

Action
1func RenderEventWidget(eventsToRender int) (string, error)
source

RenderEventWidget shows up to eventsToRender of the latest events to a caller

Types 1

type Event

struct
1type Event struct {
2	id          string
3	name        string    // name of event
4	description string    // short description of event
5	link        string    // link to auth corresponding web2 page, ie eventbrite/luma or conference page
6	location    string    // location of the event
7	startTime   time.Time // given in RFC3339
8	endTime     time.Time // end time of the event, given in RFC3339
9}
source

Methods on Event

func Render

method on Event
1func (e Event) Render(admin bool) string
source

Render returns the markdown representation of a single event instance

Imports 11

Source Files 4