Documentation ¶
Index ¶
- func CreateGptnNet(client *docker.Client)
- func GetAllContainers(client *docker.Client) ([]docker.APIContainers, error)
- func GetAllExitedContainer(cons []docker.APIContainers) ([]common.Address, error)
- func GetAllResourceUsageByContainerName(name string) (*docker.Stats, error)
- func GetCPUUsageTotalUsage(stats *docker.Stats) (uint64, error)
- func GetDiskForEachContainer(client *docker.Client, disk int64)
- func GetLogFromContainer(name string) string
- func GetMemoryStatsLimit(stats *docker.Stats) (uint64, error)
- func GetMemoryStatsUsage(stats *docker.Stats) (uint64, error)
- func GetResourcesWhenInvokeContainer(cc *list.CCInfo)
- func IsRunning(name string) bool
- func RemoveConWhenOverDisk(cc *list.CCInfo, dag dag.IDag) (sizeRW int64, disk int64, isOver bool)
- func RemoveContainerWhenGoBuildTimeOut(id string)
- func RetrieveExpiredContainers(idag dag.IDag, containers []docker.APIContainers, rmExpConFromSysParam bool) map[string]common.Address
- func StopContainerWhenInvokeTimeOut(name string)
- type UccInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGptnNet ¶ added in v1.0.3
func CreateGptnNet(client *docker.Client)
func GetAllContainers ¶ added in v1.0.3
func GetAllContainers(client *docker.Client) ([]docker.APIContainers, error)
获取所有容器
func GetAllExitedContainer ¶
获取用户合约异常退出的监听函数
func GetCPUUsageTotalUsage ¶
func GetDiskForEachContainer ¶
func GetDiskForEachContainer(client *docker.Client, disk int64)
获取所以用户合约使用的磁盘容量
func GetMemoryStatsLimit ¶
func GetMemoryStatsUsage ¶
func RemoveConWhenOverDisk ¶
调用的时候,若调用完发现磁盘使用超过系统上限,则kill掉并移除
func RemoveContainerWhenGoBuildTimeOut ¶
func RemoveContainerWhenGoBuildTimeOut(id string)
编译超时,移除容器
func RetrieveExpiredContainers ¶ added in v1.0.3
func RetrieveExpiredContainers(idag dag.IDag, containers []docker.APIContainers, rmExpConFromSysParam bool) map[string]common.Address
获取所有过期的容器ID(通过交易上的)
func StopContainerWhenInvokeTimeOut ¶
func StopContainerWhenInvokeTimeOut(name string)
当调用合约时,发生超时,即停止掉容器
Types ¶
type UccInterface ¶
type UccInterface interface { // 获取容器使用全部资源 GetResourcesWhenInvokeContainer(cc *list.CCInfo) GetAllResourceUsageByContainerName(name string) (*docker.Stats, error) // 获取CPU使用 GetCPUUsageTotalUsage(stats *docker.Stats) (uint64, error) // 获取内存使用上限 GetMemoryStatsLimit(stats *docker.Stats) (uint64, error) // 获取当前内存使用 GetMemoryStatsUsage(stats *docker.Stats) (uint64, error) // 通过容器名称获取容器里面的错误信息,返回最后一条 GetLogFromContainer(name string) string // 获取所以用户合约使用的磁盘容量 GetDiskForEachContainer(client *docker.Client, disk int64) // 获取用户合约异常退出的监听函数 GetAllExitedContainer(client *docker.Client) ([]common.Address, error) // 当调用合约时,发生超时,即停止掉容器 StopContainerWhenInvokeTimeOut(name string) // 编译超时,移除容器 RemoveContainerWhenGoBuildTimeOut(client *docker.Client, id string) }
Click to show internal directories.
Click to hide internal directories.