Documentation ¶
Overview ¶
Package funclet
Package funclet
Index ¶
- Constants
- Variables
- func CopyDir(src string, dst string, mode os.FileMode) (err error)
- func CopyFile(src, dst string, mode os.FileMode) (err error)
- func GetPathConfig(o *options.FuncletOptions) *file.PathConfig
- func ReaderToLog(r io.ReadCloser, logger *logs.Logger)
- type BsamFunctionProperties
- type BsamFunctionResource
- type BsamResources
- type BsamTemplate
- type ContainerIsBusy
- type ContainerManager
- func (m *ContainerManager) LockContainer(id string, event api.Event, ctx *funcletCtx.Context) (res bool, err error)
- func (m *ContainerManager) UnLockContainer(id string, ctx *funcletCtx.Context) (err error)
- func (m *ContainerManager) UnLockContainerWithLog(id string, ctx *funcletCtx.Context) (err error)
- type ContainerMap
- func (m *ContainerMap) Exist(id string) (info *api.ContainerInfo, exist bool)
- func (m *ContainerMap) GetContainer(id string) (info *api.ContainerInfo, err error)
- func (m *ContainerMap) UpdateContainerPid(id string, pid int) (err error)
- func (m *ContainerMap) UpdateContainerStreamMode(id string, streamMode bool) (err error)
- type ContainerNotExist
- type ContainerNotRunning
- type Funclet
- func (f *Funclet) BulkGetContainers(IDs []string) (list map[string]*api.ContainerInfo, err error)
- func (f *Funclet) ContainerInfo(ID string) (info *api.ContainerInfo, err error)
- func (f *Funclet) ContainerInfoHandler(c *server.Context)
- func (f *Funclet) ContainerListHandler(c *server.Context)
- func (f *Funclet) CoolDownHandler(c *server.Context)
- func (f *Funclet) DeleteContainer(ctx *funcletCtx.Context) (err error)
- func (f *Funclet) GetContainerConfPath(containerName string) string
- func (f *Funclet) GetNodeHandler(c *server.Context)
- func (f *Funclet) GetPidFromFile(containerID string) (pid int, err error)
- func (f *Funclet) GetUserCodePath(codeSha256 string) string
- func (f *Funclet) HelloWorldHandler(c *server.Context)
- func (f *Funclet) IDEWarmUp(ctx *funcletCtx.Context, params api.WarmupRequest) (err error)
- func (f *Funclet) IDEWarmUpContainerEvent(ctx *funcletCtx.Context, params api.WarmupRequest) (err error)
- func (f *Funclet) IDEWarmUpHandler(c *server.Context)
- func (f *Funclet) InitAllContainers()
- func (f *Funclet) InitContainer(ctx *funcletCtx.Context) (err error)
- func (f *Funclet) InitContainerEvent(containerID string) (err error)
- func (f *Funclet) InstallAPI(container *restful.Container)
- func (f *Funclet) List(criteria *api.ListContainerCriteria) (list []*api.ContainerInfo, err error)
- func (f *Funclet) ListAllContainers() (list []*api.ContainerInfo, err error)
- func (f *Funclet) NewContext(requestID string, logger *logs.Logger) *funcletCtx.Context
- func (f *Funclet) NodeInfo() (info *api.FuncletNodeInfo, err error)
- func (f *Funclet) RebornHandler(c *server.Context)
- func (f *Funclet) RecycleTask(stopCh <-chan struct{}, finishCh chan struct{})
- func (f *Funclet) RemoveTmpDevice(ctx *funcletCtx.Context, pathName string)
- func (f *Funclet) Reset() (err error)
- func (f *Funclet) ResetContainer(ctx *funcletCtx.Context) (err error)
- func (f *Funclet) ResetContainerEvent(ctx *funcletCtx.Context, params *api.ResetRequest) (err error, response *api.ResetResponse)
- func (f *Funclet) ResetContainers(ctx *funcletCtx.Context, params *api.ResetRequest) (err error, response *api.ResetResponse)
- func (f *Funclet) ResetHandler(c *server.Context)
- func (f *Funclet) SetNetwork(pid int) error
- func (f *Funclet) StartContainer(ctx *funcletCtx.Context) error
- func (f *Funclet) StopContainer(ctx *funcletCtx.Context, sync bool) (err error)
- func (f *Funclet) WaitForContainerExits(ctx *funcletCtx.Context) (err error)
- func (f *Funclet) WarmUp(ctx *funcletCtx.Context, params api.WarmupRequest) (err error)
- func (f *Funclet) WarmUpContainerEvent(ctx *funcletCtx.Context, params api.WarmupRequest) (err error)
- func (f *Funclet) WarmUpHandler(c *server.Context)
- type HandlingChanMap
- type LoopDeviceInfo
- type Meta
- type MountInfo
Constants ¶
View Source
const RuntimeHTTPSock = ".runtime-http.sock"
Variables ¶
View Source
var (
ContainerNotExists = errors.New("container not exists")
)
Functions ¶
func GetPathConfig ¶
func GetPathConfig(o *options.FuncletOptions) *file.PathConfig
func ReaderToLog ¶
func ReaderToLog(r io.ReadCloser, logger *logs.Logger)
Types ¶
type BsamFunctionProperties ¶
type BsamFunctionProperties struct { CodeUri string `yaml:"CodeUri"` Handler string `yaml:"Handler"` Runtime string `yaml:"Runtime"` MemorySize int `yaml:"MemorySize"` Timeout int `yaml:"Timeout"` Environment *api.Environment `yaml:"Environment"` }
func NewBsamFunctionProperties ¶
func NewBsamFunctionProperties(config *api.FunctionConfig) *BsamFunctionProperties
type BsamFunctionResource ¶
type BsamFunctionResource struct { Type string `yaml:"Type"` Properties *BsamFunctionProperties `yaml:"Properties"` }
func NewBsamFunctionResource ¶
func NewBsamFunctionResource(config *api.FunctionConfig) *BsamFunctionResource
type BsamResources ¶
type BsamResources map[string]*BsamFunctionResource
func NewBsamResources ¶
func NewBsamResources() BsamResources
type BsamTemplate ¶
type BsamTemplate struct { TemplateFormatVersion string `yaml:"BCETemplateFormatVersion"` Transform string `yaml:"Transform"` Description string `yaml:"Description"` Resources BsamResources `yaml:"Resources"` }
func NewBsamTemplate ¶
func NewBsamTemplate() *BsamTemplate
type ContainerIsBusy ¶
func (ContainerIsBusy) Error ¶
func (e ContainerIsBusy) Error() string
type ContainerManager ¶
type ContainerManager struct {
ContainerMap *ContainerMap
}
func NewContainerManager ¶
func NewContainerManager(podName string, o *options.FuncletOptions) *ContainerManager
func (*ContainerManager) LockContainer ¶
func (m *ContainerManager) LockContainer(id string, event api.Event, ctx *funcletCtx.Context) (res bool, err error)
func (*ContainerManager) UnLockContainer ¶
func (m *ContainerManager) UnLockContainer(id string, ctx *funcletCtx.Context) (err error)
func (*ContainerManager) UnLockContainerWithLog ¶
func (m *ContainerManager) UnLockContainerWithLog(id string, ctx *funcletCtx.Context) (err error)
type ContainerMap ¶
func InitContainerMap ¶
func InitContainerMap(podName string, num int) *ContainerMap
func (*ContainerMap) Exist ¶
func (m *ContainerMap) Exist(id string) (info *api.ContainerInfo, exist bool)
func (*ContainerMap) GetContainer ¶
func (m *ContainerMap) GetContainer(id string) (info *api.ContainerInfo, err error)
func (*ContainerMap) UpdateContainerPid ¶
func (m *ContainerMap) UpdateContainerPid(id string, pid int) (err error)
func (*ContainerMap) UpdateContainerStreamMode ¶
func (m *ContainerMap) UpdateContainerStreamMode(id string, streamMode bool) (err error)
type ContainerNotExist ¶
type ContainerNotExist struct {
ID string
}
func (ContainerNotExist) Error ¶
func (e ContainerNotExist) Error() string
type ContainerNotRunning ¶
type ContainerNotRunning struct {
ID string
}
func (ContainerNotRunning) Error ¶
func (e ContainerNotRunning) Error() string
type Funclet ¶
type Funclet struct { PodName string Options *options.FuncletOptions RuntimeClient runtime.RuntimeManagerInterface CodeManager code.ManagerInterface RunnerManager runner.RunnerManagerInterface MountManager file.MountManagerInterface PathManager file.PathManagerInterface NetworkManager network.NetworkManagerInterface TmpManager tmp.TmpManagerInterface ContainerManager *ContainerManager HandlingChanMap *HandlingChanMap // contains filtered or unexported fields }
Funclet
func InitFunclet ¶
func InitFunclet(o *options.FuncletOptions, stopCh <-chan struct{}, finishCh chan struct{}) (f *Funclet, err error)
func (*Funclet) BulkGetContainers ¶
func (*Funclet) ContainerInfo ¶
func (f *Funclet) ContainerInfo(ID string) (info *api.ContainerInfo, err error)
func (*Funclet) ContainerInfoHandler ¶
func (*Funclet) ContainerListHandler ¶
func (*Funclet) CoolDownHandler ¶
func (*Funclet) DeleteContainer ¶
func (f *Funclet) DeleteContainer(ctx *funcletCtx.Context) (err error)
func (*Funclet) GetContainerConfPath ¶
func (*Funclet) GetNodeHandler ¶
func (*Funclet) GetPidFromFile ¶
func (*Funclet) GetUserCodePath ¶
GetUserCodePath
func (*Funclet) HelloWorldHandler ¶
func (*Funclet) IDEWarmUp ¶
func (f *Funclet) IDEWarmUp(ctx *funcletCtx.Context, params api.WarmupRequest) (err error)
func (*Funclet) IDEWarmUpContainerEvent ¶
func (f *Funclet) IDEWarmUpContainerEvent(ctx *funcletCtx.Context, params api.WarmupRequest) (err error)
func (*Funclet) IDEWarmUpHandler ¶
func (*Funclet) InitAllContainers ¶
func (f *Funclet) InitAllContainers()
func (*Funclet) InitContainer ¶
func (f *Funclet) InitContainer(ctx *funcletCtx.Context) (err error)
func (*Funclet) InitContainerEvent ¶
func (*Funclet) InstallAPI ¶
func (f *Funclet) InstallAPI(container *restful.Container)
InstallAPI xxx
func (*Funclet) List ¶
func (f *Funclet) List(criteria *api.ListContainerCriteria) (list []*api.ContainerInfo, err error)
func (*Funclet) ListAllContainers ¶
func (f *Funclet) ListAllContainers() (list []*api.ContainerInfo, err error)
func (*Funclet) NewContext ¶
func (*Funclet) RebornHandler ¶
func (*Funclet) RecycleTask ¶
func (f *Funclet) RecycleTask(stopCh <-chan struct{}, finishCh chan struct{})
func (*Funclet) RemoveTmpDevice ¶
func (f *Funclet) RemoveTmpDevice(ctx *funcletCtx.Context, pathName string)
func (*Funclet) ResetContainer ¶
func (f *Funclet) ResetContainer(ctx *funcletCtx.Context) (err error)
func (*Funclet) ResetContainerEvent ¶
func (f *Funclet) ResetContainerEvent(ctx *funcletCtx.Context, params *api.ResetRequest) (err error, response *api.ResetResponse)
func (*Funclet) ResetContainers ¶
func (f *Funclet) ResetContainers(ctx *funcletCtx.Context, params *api.ResetRequest) (err error, response *api.ResetResponse)
func (*Funclet) ResetHandler ¶
func (*Funclet) SetNetwork ¶
func (*Funclet) StartContainer ¶
func (f *Funclet) StartContainer(ctx *funcletCtx.Context) error
func (*Funclet) StopContainer ¶
func (f *Funclet) StopContainer(ctx *funcletCtx.Context, sync bool) (err error)
func (*Funclet) WaitForContainerExits ¶
func (f *Funclet) WaitForContainerExits(ctx *funcletCtx.Context) (err error)
func (*Funclet) WarmUp ¶
func (f *Funclet) WarmUp(ctx *funcletCtx.Context, params api.WarmupRequest) (err error)
func (*Funclet) WarmUpContainerEvent ¶
func (f *Funclet) WarmUpContainerEvent(ctx *funcletCtx.Context, params api.WarmupRequest) (err error)
func (*Funclet) WarmUpHandler ¶
type HandlingChanMap ¶
type HandlingChanMap struct {
// contains filtered or unexported fields
}
HandlingChanMap
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package command
|
Package command |
device
|
|
loop
Package device
|
Package device |
utils
Package utils
|
Package utils |
Package device
|
Package device |
Package runner
|
Package runner |
Package runtime
|
Package runtime |
api
Package api
|
Package api |
cgroup
Package cgroup
|
Package cgroup |
error
Package runtime
|
Package runtime |
runc
Package runc
|
Package runc |
Package tmp
|
Package tmp |
hostpath
Package hostpath
|
Package hostpath |
loop
Package loop
|
Package loop |
Package tmp
|
Package tmp |
Click to show internal directories.
Click to hide internal directories.