Documentation ¶
Index ¶
- func AddMincoreLayer(req *http.Request, ssID string, position int, fromDiff string) error
- func ChangeMincoreState(ctx context.Context, ssID string, fromRecordSize int, trimRegions bool, ...) error
- func ChangeReapCacheState(req *http.Request, ssID string, cache bool) error
- func ChangeSnapshot(req *http.Request, ssID string, digHole, loadCache, dropCache bool) error
- func CopyFile(dst, src string) error
- func CopyMincore(req *http.Request, ssID string, source string) error
- func CopySnapshot(ctx context.Context, fromSnapshot, memFilePath string) (*models.Snapshot, error)
- func CreateFunction(params operations.PostFunctionsParams) error
- func DoStartVM(ctx context.Context, function, namespace string) (string, error)
- func FileMincore(f *os.File, size int64) ([]bool, error)
- func GetMincore(req *http.Request, ssID string) (*operations.GetSnapshotsSsIDMincoreOKBody, error)
- func InvokeFunction(req *http.Request, invoc *models.Invocation) (string, string, string, error)
- func LoadSnapshot(req *http.Request, invoc *models.Invocation, reapId string) (string, error)
- func PutNetwork(req *http.Request, ...) error
- func RandStringRunes(n int) string
- func ScanFileMincore(f *os.File, size int64, startLayer int, interval int, stop chan bool) ([]int, int, error)
- func ScanFileMincoreBySize(f *os.File, size int64, startLayer int, pid, sizeIncr int, stop chan bool) ([]int, int, error)
- func StartVM(req *http.Request, name, ssId, namespace string) (string, error)
- func StartVMM(ctx context.Context, enableReap bool, namespace string) (string, error)
- func StopVM(req *http.Request, vmID string) error
- func TakeSnapshot(req *http.Request, vmID string, snapshotType string, snapshotPath string, ...) (string, error)
- type BootSource
- type Config
- type DaemonState
- type Drive
- type Function
- type FunctionManager
- type MachineConfig
- type Network
- type Snapshot
- func (snapshot *Snapshot) EmulateMincore(ctx context.Context, mincoreSize int) error
- func (snapshot *Snapshot) GetNonZeroRegions(buf []byte, blockSize, sizeThreshold, intervalThreshold int)
- func (snapshot *Snapshot) InsertMincoreLayer(layer []bool, position int) error
- func (snapshot *Snapshot) PreWarmMincore(ctx context.Context, nlayers []int64) error
- func (snapshot *Snapshot) RecordRegions(ctx context.Context, sizeThreshold, intervalThreshold int) error
- func (snapshot *Snapshot) ScanMincore(r *http.Request, pid, scanInterval, sizeIncr int, finished chan bool) error
- func (snapshot *Snapshot) TrimMincoreRegions(ctx context.Context) error
- func (snapshot *Snapshot) UpdateCacheState(digHole, loadCache, dropCache bool) error
- type SnapshotManager
- func (sm *SnapshotManager) AddMincoreLayer(req *http.Request, ssID string, position int, fromDiff string) error
- func (sm *SnapshotManager) CopyMincore(r *http.Request, dst string, src string) error
- func (sm *SnapshotManager) CopySnapshot(ctx context.Context, src, memFilePath string) (*models.Snapshot, error)
- func (sm *SnapshotManager) GetMincore(r *http.Request, src string) (*operations.GetSnapshotsSsIDMincoreOKBody, error)
- func (sm *SnapshotManager) RegisterSnapshot(snapshot *Snapshot) error
- type VM
- type VMController
- func (vc *VMController) AddNetwork(req *http.Request, ...) error
- func (vc *VMController) InvokeFunction(r *http.Request, vmID string, function string, params string) (string, error)
- func (vc *VMController) LoadSnapshot(r *http.Request, snapshot *Snapshot, invoc *models.Invocation, reapId string) (string, error)
- func (vc *VMController) StartVM(ctx *context.Context, function, kernel, image, namespace string, ...) (string, error)
- func (vc *VMController) StartVMM(ctx context.Context, enableReap bool, namespace string) (string, error)
- func (vc *VMController) StopVM(req *http.Request, vmID string) error
- func (vc *VMController) TakeSnapshot(r *http.Request, vmID string, snap *Snapshot) error
- type VmConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMincoreLayer ¶
func ChangeMincoreState ¶
func ChangeReapCacheState ¶
func ChangeSnapshot ¶
func CopySnapshot ¶
func CreateFunction ¶
func CreateFunction(params operations.PostFunctionsParams) error
func GetMincore ¶
func GetMincore(req *http.Request, ssID string) (*operations.GetSnapshotsSsIDMincoreOKBody, error)
func InvokeFunction ¶
func LoadSnapshot ¶
func PutNetwork ¶
func RandStringRunes ¶
func ScanFileMincore ¶
func ScanFileMincoreBySize ¶
Types ¶
type BootSource ¶
type Config ¶
type Config struct { LogLevel string `json:"log_level"` BasePath string `json:"base_path"` Images map[string]string `json:"images"` Kernels map[string]string `json:"kernels"` Executables map[string]string `json:"executables"` RedisHost string `json:"redis_host"` RedisPasswd string `json:"redis_passwd"` }
type DaemonState ¶
type DaemonState struct { FnManager *FunctionManager `json:"functionManager"` VmController *VMController `json:"vmController"` SnapshotManager *SnapshotManager `json:"snapshotManager"` Config *Config `json:"config"` }
type FunctionManager ¶
type FunctionManager struct { sync.Mutex Functions map[string]*Function `json:"functions"` // contains filtered or unexported fields }
func NewFunctionManager ¶
func NewFunctionManager(config *Config) *FunctionManager
func (*FunctionManager) CreateFunction ¶
type MachineConfig ¶
type Snapshot ¶
type Snapshot struct { sync.Mutex Function string `json:"function"` MemFilePath string `json:"memFilePath"` WsFile string `json:"wsFile"` Size int `json:"size"` BlockSize int `json:"blockSize"` SnapshotBase string `json:"snapshotBase"` SnapshotType string `json:"snapshotType"` SnapshotId string `json:"snapshotId"` SnapshotPath string `json:"snapshotPath"` Version string `json:"functionVersion"` // contains filtered or unexported fields }
func (*Snapshot) EmulateMincore ¶
func (*Snapshot) GetNonZeroRegions ¶
func (*Snapshot) InsertMincoreLayer ¶
func (*Snapshot) PreWarmMincore ¶
func (*Snapshot) RecordRegions ¶
func (*Snapshot) ScanMincore ¶
func (*Snapshot) TrimMincoreRegions ¶
func (*Snapshot) UpdateCacheState ¶
type SnapshotManager ¶
type SnapshotManager struct { sync.Mutex Snapshots map[string]*Snapshot `json:"snapshots"` // contains filtered or unexported fields }
func NewSnapshotManager ¶
func NewSnapshotManager(config *Config) *SnapshotManager
func (*SnapshotManager) AddMincoreLayer ¶
func (*SnapshotManager) CopyMincore ¶
func (*SnapshotManager) CopySnapshot ¶
func (*SnapshotManager) GetMincore ¶
func (sm *SnapshotManager) GetMincore(r *http.Request, src string) (*operations.GetSnapshotsSsIDMincoreOKBody, error)
func (*SnapshotManager) RegisterSnapshot ¶
func (sm *SnapshotManager) RegisterSnapshot(snapshot *Snapshot) error
type VM ¶
type VM struct { sync.Mutex VmId string `json:"vmId"` Function string `json:"function"` State string `json:"state"` Socket string `json:"socket"` VMNetwork *Network `json:"net"` VmConf *VmConfig `json:"vmConf"` VmPath string `json:"vmPath"` MincoreSize int `json:"mincoreSize"` ReapId string `json:"reapId"` Snapshot *Snapshot // contains filtered or unexported fields }
type VMController ¶
type VMController struct { sync.Mutex BasePath string `json:"basePath"` Machines map[string]*VM `json:"machines"` Networks map[string]*Network `json:"netInterfaces"` VMMPool map[string]*VM `json:"vmmPool"` // contains filtered or unexported fields }
func NewVMController ¶
func NewVMController(config *Config) *VMController
func (*VMController) AddNetwork ¶
func (vc *VMController) AddNetwork(req *http.Request, namespace, hostDevName, ifaceId, guestMac, guestAddr, uniqueAddr string) error
func (*VMController) InvokeFunction ¶
func (*VMController) LoadSnapshot ¶
func (vc *VMController) LoadSnapshot(r *http.Request, snapshot *Snapshot, invoc *models.Invocation, reapId string) (string, error)
func (*VMController) TakeSnapshot ¶
type VmConfig ¶
type VmConfig struct { BootSource BootSource `json:"boot-source"` Drives []Drive `json:"drives"` MachineConfig MachineConfig `json:"machine-config"` Networks []Network `json:"network-interfaces"` }
Click to show internal directories.
Click to hide internal directories.