functions

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package functions is a generated protocol buffer package.

It is generated from these files:

github.com/appcelerator/amp/data/functions/functions.proto

It has these top-level messages:

Function
FunctionCall
FunctionReturn

Index

Constants

View Source
const (
	InvalidName           = Error("name is invalid")
	InvalidImage          = Error("image is invalid")
	FunctionAlreadyExists = Error("function already exists")
	FunctionNotFound      = Error("function not found")
)

Errors

Variables

This section is empty.

Functions

func CheckImage

func CheckImage(image string) (string, error)

CheckImage checks image name

func CheckName

func CheckName(name string) (string, error)

CheckName checks name

Types

type Error

type Error string

Error type

func (Error) Error

func (e Error) Error() string

type Function

type Function struct {
	Id       string            `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Name     string            `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	Image    string            `protobuf:"bytes,3,opt,name=image" json:"image,omitempty"`
	Owner    *accounts.Account `protobuf:"bytes,4,opt,name=owner" json:"owner,omitempty"`
	CreateDt int64             `protobuf:"varint,5,opt,name=create_dt,json=createDt" json:"create_dt,omitempty"`
}

func (*Function) Descriptor

func (*Function) Descriptor() ([]byte, []int)

func (*Function) GetCreateDt

func (m *Function) GetCreateDt() int64

func (*Function) GetId

func (m *Function) GetId() string

func (*Function) GetImage

func (m *Function) GetImage() string

func (*Function) GetName

func (m *Function) GetName() string

func (*Function) GetOwner

func (m *Function) GetOwner() *accounts.Account

func (*Function) ProtoMessage

func (*Function) ProtoMessage()

func (*Function) Reset

func (m *Function) Reset()

func (*Function) String

func (m *Function) String() string

func (*Function) Validate

func (f *Function) Validate() (err error)

Validate validates Function

type FunctionCall

type FunctionCall struct {
	CallID   string    `protobuf:"bytes,1,opt,name=callID" json:"callID,omitempty"`
	Input    []byte    `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"`
	Function *Function `protobuf:"bytes,3,opt,name=function" json:"function,omitempty"`
	ReturnTo string    `protobuf:"bytes,4,opt,name=returnTo" json:"returnTo,omitempty"`
}

func (*FunctionCall) Descriptor

func (*FunctionCall) Descriptor() ([]byte, []int)

func (*FunctionCall) GetCallID

func (m *FunctionCall) GetCallID() string

func (*FunctionCall) GetFunction

func (m *FunctionCall) GetFunction() *Function

func (*FunctionCall) GetInput

func (m *FunctionCall) GetInput() []byte

func (*FunctionCall) GetReturnTo

func (m *FunctionCall) GetReturnTo() string

func (*FunctionCall) ProtoMessage

func (*FunctionCall) ProtoMessage()

func (*FunctionCall) Reset

func (m *FunctionCall) Reset()

func (*FunctionCall) String

func (m *FunctionCall) String() string

type FunctionReturn

type FunctionReturn struct {
	CallID string `protobuf:"bytes,1,opt,name=callID" json:"callID,omitempty"`
	Output []byte `protobuf:"bytes,2,opt,name=output,proto3" json:"output,omitempty"`
}

func (*FunctionReturn) Descriptor

func (*FunctionReturn) Descriptor() ([]byte, []int)

func (*FunctionReturn) GetCallID

func (m *FunctionReturn) GetCallID() string

func (*FunctionReturn) GetOutput

func (m *FunctionReturn) GetOutput() []byte

func (*FunctionReturn) ProtoMessage

func (*FunctionReturn) ProtoMessage()

func (*FunctionReturn) Reset

func (m *FunctionReturn) Reset()

func (*FunctionReturn) String

func (m *FunctionReturn) String() string

type Interface

type Interface interface {
	// CreateFunction creates a new function
	CreateFunction(ctx context.Context, name string, image string) (function *Function, err error)

	// GetFunction fetches a function by id
	GetFunction(ctx context.Context, id string) (function *Function, err error)

	// GetFunctionByName fetches a function by name
	GetFunctionByName(ctx context.Context, name string) (function *Function, err error)

	// ListFunctions lists functions
	ListFunctions(ctx context.Context) (functions []*Function, err error)

	// DeleteFunction deletes a function by id
	DeleteFunction(ctx context.Context, id string) (err error)

	// Reset resets the function store
	Reset(ctx context.Context)
}

Interface defines the function data access layer

type Store

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

Store implements function data.Interface

func NewStore

func NewStore(store storage.Interface) *Store

NewStore returns an etcd implementation of function.Interface

func (*Store) CreateFunction

func (s *Store) CreateFunction(ctx context.Context, name string, image string) (function *Function, err error)

CreateFunction creates a new function

func (*Store) DeleteFunction

func (s *Store) DeleteFunction(ctx context.Context, id string) error

DeleteFunction deletes a function by id

func (*Store) GetFunction

func (s *Store) GetFunction(ctx context.Context, id string) (*Function, error)

GetFunction fetches a function by id

func (*Store) GetFunctionByName

func (s *Store) GetFunctionByName(ctx context.Context, name string) (function *Function, err error)

GetFunctionByName fetches a function by name

func (*Store) ListFunctions

func (s *Store) ListFunctions(ctx context.Context) ([]*Function, error)

ListFunctions lists functions

func (*Store) Reset

func (s *Store) Reset(ctx context.Context)

Reset resets the account store

Jump to

Keyboard shortcuts

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