tink

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionToDockerHostConfig

func ActionToDockerHostConfig(ctx context.Context, workflowAction *workflow.WorkflowAction, opts ...hostOpt) *container.HostConfig

ActionToDockerHostConfig converts a tink action spec to a container host config spec

func FilterActionsByWorkerID

func FilterActionsByWorkerID(id string) actFilterByFunc

FilterActionsByWorkerID will return only workflows whose hardware devices contains the given mac

func GetActionsList

func GetActionsList(ctx context.Context, workflowID string, workflowClient workflow.WorkflowServiceClient, filterByFunc ...actFilterByFunc) (actions []*workflow.WorkflowAction, err error)

GetActionsList will get all workflows actions for a given workflowID. It will optionally, filter the workflow actions based on any filterByFunc passed in

func GetHardwareID

func GetHardwareID(ctx context.Context, client hardware.HardwareServiceClient, identifier string) (string, error)

GetHardwareID returns the hardware ID from tink server. it will identify if the identifier is an IP or a MAC address and make the correct call to tink. this hardware ID is what tink uses for the "worker_id". the worker_id is used to identify a specific worker and to be able to query tink for things like assigned workflows and actions.

func GetWorkflowContexts

func GetWorkflowContexts(ctx context.Context, workerID string, client workflow.WorkflowServiceClient) ([]*workflow.WorkflowContext, error)

GetWorkflowContexts returns a slice of workflow contexts (a context is whether there is a workflow task assigned to this workerID) if the returned slice is not empty then there is something to be executed by this workerID

func ToDockerConf added in v0.3.0

func ToDockerConf(ctx context.Context, workflowAction *workflow.WorkflowAction, opts ...configOpt) *container.Config

ToDockerConf takes a workflowAction and translates it to a docker container config

Types

This section is empty.

Jump to

Keyboard shortcuts

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