service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	Trackers             map[string]tracker.Interface
	TicketsStore         engine.Tickets
	Flow                 engine.Flow
	Log                  logx.Logger
	UpdateTimeout        time.Duration
	SubscriptionsManager *SubscriptionsManager
}

Actor receives updates from the Tracker and follows the calls the actions in the wrapped tracker according to the job provided by the Flow.

func (*Actor) HandleWebhook

func (s *Actor) HandleWebhook(w http.ResponseWriter, r *http.Request)

HandleWebhook handles all webhooks to trackers

func (*Actor) Listen

func (s *Actor) Listen(ctx context.Context) error

Listen runs the updates' listener. Always returns non-nil error. Blocking call.

type SubscriptionsManager

type SubscriptionsManager struct {
	BaseURL string // must be without trailing slash
	Router  *mux.Router
	Logger  logx.Logger
	Addr    string
	Store   engine.Subscriptions
}

SubscriptionsManager manages subscriptions for task updates in trackers, including creation of subscriptions and recognizing particular subscription.

func (*SubscriptionsManager) Create

func (m *SubscriptionsManager) Create(ctx context.Context, tracker, trigger string) (store.Subscription, error)

Create registers a new subscription for a specific trigger.

func (*SubscriptionsManager) Delete

func (m *SubscriptionsManager) Delete(ctx context.Context, subscriptionID string) error

Delete proxies the call to the Store.

func (*SubscriptionsManager) List

func (m *SubscriptionsManager) List(ctx context.Context, tracker string) ([]store.Subscription, error)

List proxies the call to the wrapped Store.

func (*SubscriptionsManager) Listen

func (m *SubscriptionsManager) Listen(ctx context.Context, handler http.Handler) error

Listen starts the subscription server.

func (*SubscriptionsManager) SetTrackerRef

func (m *SubscriptionsManager) SetTrackerRef(ctx context.Context, subscriptionID, trackerRef string) error

SetTrackerRef updates the subscription by setting the remote tracker ID to the desired subscription.

Jump to

Keyboard shortcuts

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