Skip to content

Library for delayed sending message to channel with ability to cancel sending.

License

Notifications You must be signed in to change notification settings

horockey/go-scheduler

Repository files navigation

go-scheduler

CI Go Report Card Go Coverage

Go Reference License

Library for delayed sending message to channel with ability to cancel sending.

Installation

go get github.com/horockey/go-scheduler@latest

Examples

See /example directory

Events

Library is working with entities called events. Event is simply payload, wrapped with tags and headers:

type Event[T any] struct {
	Payload T
	tags    map[string]struct{}
	headers map[string]string
}

Creating event via NewEvent() method sets 2 default headers to it:

  • CREATED_AT header is set to time.Now()
  • ID header is set to uuid.NewString()

You are free to add any tags and headers to your events.

Note

Adding new tags and headers to event keep in mind, that they will be canonicalized (strings.ToUpper()) before actual addition to event

About

Library for delayed sending message to channel with ability to cancel sending.

Resources

License

Stars

Watchers

Forks

Languages