controller

package
v0.0.0-...-6f0d270 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the API client that performs all operations against a Worker.

func NewClient

func NewClient(config Config) (*Client, error)

NewClient initializes a new API client

func (*Client) ClearContainer

func (c *Client) ClearContainer(ctx context.Context) error

func (*Client) Close

func (c *Client) Close()

Close stops the client and wait for all the resource release

func (*Client) InitFunction

func (c *Client) InitFunction(ctx context.Context, req *wpb.InitFunctionRequest) (*wpb.InitFunctionResponse, error)

InitFunction the Manager pass function info to Worker

func (*Client) Invoke

func (c *Client) Invoke(ctx context.Context, req *wpb.InvokeRequest) (*wpb.InvokeResponse, error)

Invoke exec a function with name and payload

func (*Client) Metrics

func (c *Client) Metrics(ctx context.Context, req *wpb.MetricsRequest) (*wpb.MetricsResponse, error)

Metrics is used to retrive worker's overhead and resource utilization

func (*Client) Register

func (c *Client) Register(ctx context.Context, req *wpb.RegisterRequest) (res *wpb.RegisterResponse, err error)

Register is for a function exec env register itself into Worker env-list

func (*Client) Reset

func (c *Client) Reset(ctx context.Context, req *wpb.ResetRequest) (*wpb.ResetResponse, error)

Reset moves the func container to idle-list

type Config

type Config struct {
	Localhost             string
	ListenPort            string
	ContainerEnvVariables []string
}

Config is used to initialize controller client It supports adjusting the resource limits

type FuncResource

type FuncResource struct {
	FuncName   string
	Image      string
	CodeURL    string
	Runtime    string
	Timeout    int64
	MemorySize int64
}

Jump to

Keyboard shortcuts

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