Documentation ¶
Index ¶
- type Certs
- type Executable
- type ExecutableConfig
- type Forward
- type Handler
- type HandlerFunc
- type Logger
- type Repository
- type Request
- type Response
- type Result
- type Router
- func (h *Router) Handle(ctx context.Context, req *Request) Response
- func (h *Router) NotFound(handler Handler)
- func (h *Router) NotFoundFunc(handler HandlerFunc)
- func (h *Router) Register(name string, handler Handler)
- func (h *Router) RegisterFunc(name string, handler HandlerFunc)
- func (h *Router) ResolveExpressions(ctx context.Context, secrets []*common.Secret, taskData []byte) ([]byte, error)
- func (h *Router) ResolveSecrets(ctx context.Context, tasks []*Task) ([]*common.Secret, error)
- func (h *Router) Use(fn func(Handler) Handler)
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certs ¶
type Certs struct { Public []byte `json:"public"` Private []byte `json:"private"` CA []byte `json:"ca"` }
Certs provides tls certificates.
type Executable ¶
Executable provides the url to download a custom binary task executable file, given the operating system and architecture
type ExecutableConfig ¶
type ExecutableConfig struct {
Executables []Executable `json:"executables"`
}
ExecutableConfig provides the details to download a custom binary task executable file, for all supported operating systems and architectures
type Forward ¶
type Forward struct { Address string `json:"string"` Insecure bool `json:"insecure"` Certs Certs `json:"certs"` }
Forward provides instructions for forward a task to another runner node in the network.
type HandlerFunc ¶
The HandlerFunc type is an adapter to allow the use of ordinary functions as task handlers.
type Logger ¶
type Logger struct { Address string `json:"address"` Insecure bool `json:"insecure"` Token string `json:"token"` Key string `json:"key"` Account string `json:"account"` IndirectUpload bool `json:"indirect_upload"` }
Logger provides instructions for logging the output of a task execution.
type Repository ¶
type Repository struct { Clone string `json:"clone"` Ref string `json:"ref"` Sha string `json:"sha"` Download string `json:"download"` }
Repository provides the repository used for custom task execution.
type Request ¶
type Request struct { // Task provides the current task. Task *Task `json:"task"` // Tasks provides the previous task // execution results. Tasks []*Task `json:"secrets"` // Secrets provides the names and values of secrets // that are available to the task execution. Secrets []*common.Secret `json:"-"` // Account provides the account identifier. Account string `json:"account"` // ID provides a unique identifier to track the status of the request. ID string `json:"id"` // Logger is available to the task execution to write log output. Logger io.Writer `json:"-"` }
Request defines a task request.
type Response ¶
type Response interface { // Body gets the response body. Body() []byte // Error gets the response error. Error() error }
Response is a response interface.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router routes task execution requests to the appropriate handler.
func (*Router) NotFoundFunc ¶
func (h *Router) NotFoundFunc(handler HandlerFunc)
NotFoundFunc adds a handler to response whenver a route cannot be found.
func (*Router) RegisterFunc ¶
func (h *Router) RegisterFunc(name string, handler HandlerFunc)
RegisterFunc registers the HandlerFunc to the router.
func (*Router) ResolveExpressions ¶
func (*Router) ResolveSecrets ¶
type Task ¶
type Task struct { // ID provides a unique task identifier. ID string `json:"id"` // Type provides the task type. Type string `json:"type"` // Data provides task execution data. Data []byte `json:"data"` // Driver provides the execution driver used to // execute the task. Driver string `json:"driver"` // Config provides the execution driver configuration. Config []byte `json:"config"` // Forward provides instructions for forwarding // the task to another runner node in the network. Forward *Forward `json:"forward"` // Logger provides instructions on where to log the output. Logger *Logger `json:"logger"` }