lib

package module
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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
}

Logger is a logger interface.

type Plugin

type Plugin struct {
	Address string
	Logger  Logger // no-op by default
}

Plugin provides methods to start listener and register RPC methods.

func (*Plugin) Listen

func (p *Plugin) Listen(ctx context.Context, rcvr interface{}) (err error)

Listen starts RPC server and listens for incoming connections.

type Request

type Request struct {
	// TaskID in the target plugin, might be empty if the request is for creation
	TaskID string `json:"task_id"`
	Vars   Vars   `json:"vars"`
}

Request describes a request to tracker's action.

type Response

type Response struct {
	Task Task `json:"task"` // contains the update of the created/updated task in tracker
}

Response describes possible return values of the tracker's action.

type SubscribeReq

type SubscribeReq struct {
	WebhookURL string `json:"webhook_url"`
	Vars       Vars   `json:"vars"`
}

SubscribeReq describes parameters of the subscription for task updates.

type SubscribeResp

type SubscribeResp struct {
	TrackerRef string `json:"tracker_ref"`
}

SubscribeResp describes the response of the subscription request.

type SubscriptionSupporter

type SubscriptionSupporter interface {
	Subscribe(req SubscribeReq, resp *SubscribeResp) error
	Unsubscribe(req UnsubscribeReq, _ *struct{}) error
}

SubscriptionSupporter provides methods to subscribe to events. If plugin needs to support subscriptions, it should implement this interface.

type Task added in v0.2.0

type Task struct {
	ID     string            `json:"id"`
	URL    string            `json:"url"`
	Title  string            `json:"title"`
	Body   string            `json:"body"`
	Fields map[string]string `json:"fields"`
}

Task describes an updated task representation in dastracker.

type UnsubscribeReq

type UnsubscribeReq struct {
	TrackerRef string `json:"tracker_ref"`
}

UnsubscribeReq describes parameters of the unsubscription from task updates.

type Vars

type Vars map[string]string

Vars is an alias for a map with variable values.

func (Vars) Equal

func (v Vars) Equal(oth Vars) bool

Equal returns true if two sets of variables represent the same one. Note: two sets of variables with different Evaluated state are considered to be equal, so the Evaluated state, in case if important, must be checked separately.

func (Vars) Get

func (v Vars) Get(name string) string

Get returns the value of the variable.

func (*Vars) Has

func (v *Vars) Has(key string) bool

Has returns true if variable with specified key is present.

func (Vars) List

func (v Vars) List(s string) []string

List returns a list of strings from var's value parsed in form of "string1,string2,string3"

func (*Vars) Set

func (v *Vars) Set(name, val string)

Set sets the value of the variable.

func (*Vars) UnmarshalYAML

func (v *Vars) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements unmarshaler in order to parse the map of values.

Jump to

Keyboard shortcuts

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