worker

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package worker provides the ability for inserting Vela worker resources into or extracting Vela worker resources from the middleware chain for the API.

Usage:

import "github.com/go-vela/server/router/middleware/worker"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Establish

func Establish() gin.HandlerFunc

Establish sets the worker in the given context.

func FromContext

func FromContext(c context.Context) *library.Worker

FromContext returns the Worker associated with this context.

func Retrieve

func Retrieve(c *gin.Context) *library.Worker

Retrieve gets the worker in the given context.

func ToContext

func ToContext(c Setter, w *library.Worker)

ToContext adds the Worker to this context if it supports the Setter interface.

Types

type Setter

type Setter interface {
	Set(string, interface{})
}

Setter defines a context that enables setting values.

Jump to

Keyboard shortcuts

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