croneventsrcsvc

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCronspec = errors.New("invalid cronspec")
View Source
var EventTypes = []string{"tick"}

Functions

This section is empty.

Types

type Config

type Config struct {
	EventSourceID apieventsrc.EventSourceID `envconfig:"EVENT_SOURCE_ID" json:"event_source_id"`

	// This might be wanted off in real deployment - trigger can be done by external HTTP source
	// so only one cron svc will be active at any given tick. If this is != 0, all instances
	// will try to schedule which might trigger unwanted redundant ticks.
	LocalTickInterval           time.Duration `envconfig:"LOCAL_TICK_INTERVAL" default:"1m" json:"local_tick_interval"`
	LocalTickIntervalOffsetRand bool          `envconfig:"LOCAL_TICK_INTERVAL_RAND_OFFSET" default:"true" json:"local_tick_interval_rand_offset"`
}

type Svc

type Svc struct {
	pb.UnimplementedCronEventSourceServer

	Config       Config
	StateStore   kvstore.Store
	Events       *events.Events
	EventSources eventsrcsstore.Store
	L            L.Nullable
}

func (*Svc) Add

func (s *Svc) Add(ctx context.Context, pid apiproject.ProjectID, name, spec string) error

func (*Svc) Bind

func (s *Svc) Bind(ctx context.Context, req *pb.BindRequest) (*pb.BindResponse, error)

func (*Svc) Register

func (s *Svc) Register(ctx context.Context, srv *grpc.Server, gw *runtime.ServeMux)

func (*Svc) Start

func (s *Svc) Start()

func (*Svc) Tick

func (*Svc) Unbind

func (s *Svc) Unbind(ctx context.Context, req *pb.UnbindRequest) (*pb.UnbindResponse, error)

Jump to

Keyboard shortcuts

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