events source realm
Package events allows you to upload data about specific IRL/online events It includes dynamic support for updating re...
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.
2
const MaxWidgetSize
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)var Ownable, events, idCounter
6
func AddEvent
crossing Action1func AddEvent(cur realm, name, description, link, location, startTime, endTime string) (string, error)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 ActionDeleteEvent deletes an event with auth given ID
func EditEvent
crossing Action1func EditEvent(cur realm, id string, name, description, link, location, startTime, endTime string)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
Render is the main rendering entry point
func RenderEventWidget
ActionRenderEventWidget shows up to eventsToRender of the latest events to a caller
func GetEventByID
Action1
type Event
struct1type 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}11
- bytes stdlib
- chain stdlib
- errors stdlib
- gno.land/p/moul/md package
- gno.land/p/nt/ownable/v0 package
- gno.land/p/nt/seqid/v0 package
- gno.land/p/nt/ufmt/v0 package
- sort stdlib
- strconv stdlib
- strings stdlib
- time stdlib