service

package
v0.4.1-alpha1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

@Author: LinkLeong link@icewhale.com

*@Date: 2022-07-12 09:48:56
*@LastEditors: LinkLeong
*@LastEditTime: 2022-09-02 22:10:05
*@FilePath: /CasaOS/service/service.go
*@Description:
*@Website: https://www.casaos.io
*Copyright (c) 2022 by icewhale, All Rights Reserved.

Index

Constants

This section is empty.

Variables

View Source
var (
	Cache         *cache.Cache
	MyService     Services
	NewVersionApp map[string]string
)

Functions

func DockerContainerStats1

func DockerContainerStats1() error

func GetToken

func GetToken() string

func RemoveImage added in v0.4.1

func RemoveImage(name string) error

Types

type AppStore added in v0.4.1

type AppStore interface {
	GetServerList(index, size, tp, categoryID, key string) (model.ServerAppListCollection, error)
	GetServerAppInfo(id, t string, language string) (model.ServerAppList, error)
	GetServerCategoryList() (list []model.CategoryList, err error)
	AsyncGetServerCategoryList() ([]model.CategoryList, error)
	ShareAppFile(body []byte) string
}

func NewAppService

func NewAppService() AppStore

type DockerService

type DockerService interface {
	// image
	IsExistImage(imageName string) bool
	PullImage(imageName string, icon, name string) error
	RemoveImage(name string) error

	// container
	CheckContainerHealth(id string) (bool, error)
	CloneContainer(info *types.ContainerJSON) (containerID string, err error)
	CreateContainer(m model.CustomizationPostData, id string) (containerID string, err error)
	CreateContainerShellSession(container, row, col string) (hr types.HijackedResponse, err error)
	DescribeContainer(name string) (*types.ContainerJSON, error)
	GetContainer(id string) (types.Container, error)
	GetContainerAppList(name, image, state *string) (*[]model.MyAppList, *[]model.MyAppList)
	GetContainerByName(name string) (*types.Container, error)
	GetContainerLog(name string) ([]byte, error)
	GetContainerStats() []model.DockerStatsModel
	RemoveContainer(name string, update bool) error
	RenameContainer(name, id string) (err error)
	StartContainer(name string) error
	StopContainer(id string) error

	// network
	GetNetworkList() []types.NetworkResource

	// docker server
	GetServerInfo() (types.Info, error)
}

func NewDockerService

func NewDockerService() DockerService

type Services

type Services interface {
	AppStore() AppStore
	Docker() DockerService
	Gateway() external.ManagementService
	Notify() external.NotifyService
	MessageBus() *message_bus.ClientWithResponses
}

func NewService

func NewService(RuntimePath string) Services

Jump to

Keyboard shortcuts

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