service

package
v0.4.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 38 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     Repository
	NewVersionApp map[string]string
)

Functions

func DockerContainerStats1

func DockerContainerStats1() error

func DockerEx

func DockerEx()

拉取镜像

func DockerImageRemove

func DockerImageRemove(name string) error

func DockerLog

func DockerLog()

func DockerLogs

func DockerLogs()

func DockerNetwork

func DockerNetwork()

创建默认网络

func DockerPull

func DockerPull()

拉取镜像

func Exec

func Exec(container, row, col string) (hr types.HijackedResponse, err error)

func GetToken

func GetToken() string

func MsqlExec

func MsqlExec(container string) error

Types

type AppService

type AppService 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

	GetMyList(index, size int, position bool) (*[]model2.MyAppList, *[]model2.MyAppList)
	SaveContainer(m model2.AppListDBModel)
	GetUninstallInfo(id string) model2.AppListDBModel
	DeleteApp(id string)
	GetContainerInfo(id string) (types.Container, error)
	GetAppDBInfo(id string) model2.AppListDBModel
	UpdateApp(m model2.AppListDBModel)
	GetSimpleContainerInfo(id string) (types.Container, error)
	DelAppConfigDir(path string)
	GetSystemAppList() []types.Container
	GetHardwareUsageStream()
	GetHardwareUsage() []model.DockerStatsModel
	GetAppStats(id string) string
	GetAllDBApps() []model2.AppListDBModel
	ImportApplications(casaApp bool)
	CheckNewImage()
}

func NewAppService

func NewAppService(db *gorm.DB) AppService

type DockerService

type DockerService interface {
	DockerPullImage(imageName string, icon, name string) error
	IsExistImage(imageName string) bool
	DockerContainerCreate(m model.CustomizationPostData, id string) (containerId string, err error)
	DockerContainerCopyCreate(info *types.ContainerJSON) (containerId string, err error)
	DockerContainerStart(name string) error
	DockerContainerStats(name string) (string, error)
	DockerListByName(name string) (*types.Container, error)
	DockerListByImage(image, version string) (*types.Container, error)
	DockerContainerInfo(name string) (*types.ContainerJSON, error)
	DockerImageRemove(name string) error
	DockerContainerRemove(name string, update bool) error
	DockerContainerStop(id string) error
	DockerContainerUpdateName(name, id string) (err error)
	DockerContainerUpdate(m model.CustomizationPostData, id string) (err error)
	DockerContainerLog(name string) ([]byte, error)
	DockerContainerCommit(name string)
	DockerContainerList() []types.Container
	DockerNetworkModelList() []types.NetworkResource
	DockerImageInfo(image string) (types.ImageInspect, error)
	GetNetWorkNameByNetWorkID(id string) (string, error)
	ContainerExecShell(container_id string) string
	GetDockerInfo() (types.Info, error)
}

func NewDockerService

func NewDockerService() DockerService

type Repository

type Repository interface {
	App() AppService
	Docker() DockerService
	Gateway() external.ManagementService
}

func NewService

func NewService(db *gorm.DB, RuntimePath string) Repository

Directories

Path Synopsis
* @Author: LinkLeong link@icewhale.com * @Date: 2022-05-13 18:15:46 * @LastEditors: LinkLeong * @LastEditTime: 2022-07-13 10:56:34 * @FilePath: /CasaOS/service/model/o_container.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
* @Author: LinkLeong link@icewhale.com * @Date: 2022-05-13 18:15:46 * @LastEditors: LinkLeong * @LastEditTime: 2022-07-13 10:56:34 * @FilePath: /CasaOS/service/model/o_container.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.

Jump to

Keyboard shortcuts

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