Documentation ¶
Index ¶
- Variables
- func Evaluate(v lib.Vars, data EvalData) (lib.Vars, error)
- func PutSubscription(ctx context.Context, wh Subscription) context.Context
- type Action
- type Content
- type EvalData
- type If
- type Job
- type Locator
- type Sequence
- type Step
- type Subscription
- type Task
- type Ticket
- type TicketFields
- type Tracker
- type Trigger
- type Update
- type Variations
Constants ¶
This section is empty.
Variables ¶
var ErrNoSubscription = errors.New("no subscription in the provided context")
ErrNoSubscription indicates that the subscription in the provided context was not found.
Functions ¶
func PutSubscription ¶
func PutSubscription(ctx context.Context, wh Subscription) context.Context
PutSubscription puts the provided subscription information to the given context. Should not be used out of tests outside of subscription package.
Types ¶
type Action ¶
type Action struct { Name string `yaml:"action"` With lib.Vars `yaml:"with"` Detached bool `yaml:"detached"` // means, that the action could be run asynchronously }
Action describes a single call to the tracker's method.
type Content ¶
type Content struct { Body string `json:"body"` Title string `json:"title"` Fields TicketFields `json:"fields"` }
Content contains the data in the task itself.
type EvalData ¶ added in v0.2.0
EvalData combines all the possible data to evaluate the template/expression..
type Job ¶
type Job struct { Name string `yaml:"name"` TriggerName string `yaml:"on"` Actions Sequence `yaml:"do"` }
Job describes a control sequence.
type Locator ¶
Locator describes the path to the entity in the specific tracker.
type Sequence ¶
type Sequence []Step
Sequence is a set of actions
func (*Sequence) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface
type Subscription ¶
type Subscription struct { ID string `json:"id"` TrackerRef string `json:"tracker_ref"` TrackerName string `json:"tracker_name"` TriggerName string `json:"trigger_name"` BaseURL string `json:"base_url"` }
Subscription describes configuration for subscription in trackers.
func GetSubscription ¶
func GetSubscription(ctx context.Context) (Subscription, error)
GetSubscription extracts a subscription from the given context.
func (Subscription) URL ¶
func (s Subscription) URL() string
URL composes webhook URL from the subscription data.
type Ticket ¶
type Ticket struct { ID string `json:"id"` Variations Variations `json:"variations"` // map[tracker name]Task }
Ticket describes a basic task/ticket in task tracker.
type TicketFields ¶
TicketFields is an alias for a map of fields in form of map[fieldName]fieldValue.
type Tracker ¶
type Tracker struct { Name string `yaml:"name"` Driver string `yaml:"driver"` With lib.Vars `yaml:"with"` }
Tracker describes a connection parameters to the certain tracker.
type Trigger ¶
type Trigger struct { Name string `yaml:"name"` Tracker string `yaml:"in"` With lib.Vars `yaml:"with"` }
Trigger describes an action, which has to appear to trigger a control flow.
type Variations ¶ added in v0.2.0
Variations is a set of Ticket variations in task trackers.
func (Variations) Get ¶ added in v0.2.0
func (v Variations) Get(tracker string) Task
Get returns the task for the given tracker.
func (Variations) Has ¶ added in v0.2.0
func (v Variations) Has(tracker string) bool
Has returns true if the given tracker is present in the variations of ticket.
func (Variations) Locators ¶ added in v0.2.0
func (v Variations) Locators() []Locator
Locators returns the task tracker and task ID of the ticket in each registered task tracker.
func (*Variations) Set ¶ added in v0.2.0
func (v *Variations) Set(tracker string, task Task)
Set sets the task in the ticket