httpmanager

package
v0.0.0-...-47efce2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Aliyun  aliyun.Config `yaml:"aliyun"`
	Aws     aws.Config    `yaml:"aws"`
	Server  HTTPConfig    `yaml:"server"`
	Storage StorageConfig `yaml:"storage"`
}

Config includes

type HTTPConfig

type HTTPConfig struct {
	Port string `yaml:"port"`
}

HTTPConfig includes the parameter related to http server

type Manager

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

Manager works as an adaptor between JointFaaS and specified cloud

func NewManager

func NewManager(config Config) (*Manager, error)

NewManager builds a manager with given config

func (*Manager) DelHandler

func (m *Manager) DelHandler(w http.ResponseWriter, r *http.Request)

DelHandler deletes a function

func (*Manager) GetHandler

func (m *Manager) GetHandler(w http.ResponseWriter, r *http.Request)

GetHandler returns a function metadata

func (*Manager) InfoHandler

func (m *Manager) InfoHandler(w http.ResponseWriter, r *http.Request)

InfoHandler returns the basic info of the cloud

func (*Manager) InvokeHandler

func (m *Manager) InvokeHandler(w http.ResponseWriter, r *http.Request)

InvokeHandler invokes a function

func (*Manager) ListHandler

func (m *Manager) ListHandler(w http.ResponseWriter, r *http.Request)

ListHandler A new worker registers

func (*Manager) ListenAndServe

func (m *Manager) ListenAndServe() error

ListenAndServe starts the Manager main process

func (*Manager) RegisterHandler

func (m *Manager) RegisterHandler(w http.ResponseWriter, r *http.Request)

RegisterHandler a new worker registers

func (*Manager) UploadHandler

func (m *Manager) UploadHandler(w http.ResponseWriter, r *http.Request)

UploadHandler creates a new function

type PlatformManager

type PlatformManager interface {
	CreateFunction(funcName string, dir string, e env.Env, memory string, timeout string) error
	InvokeFunction(funcName string, args []byte) ([]byte, error)
	ListFunction() ([]*function.Meta, error)
	GetFunction(funcName string) (*function.Meta, error)
	DeleteFunction(funcName string) error
	GetCodeURI(funcName string) (string, error)
	GetImage(funcName string) (string, error)
	SaveCode(funcName string, file string) error
}

PlatformManager is a layer to decouple backend

type StorageConfig

type StorageConfig struct {
	Addr string `yaml:"addr"`
}

Jump to

Keyboard shortcuts

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