Documentation
¶
Overview ¶
* @Author: LinkLeong link@icewhale.org * @Date: 2022-07-26 18:13:22 * @LastEditors: LinkLeong * @LastEditTime: 2022-08-04 20:10:31 * @FilePath: /CasaOS/service/connections.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
* @Author: LinkLeong link@icewhale.com * @Date: 2021-12-20 14:15:46 * @LastEditors: LinkLeong * @LastEditTime: 2022-07-04 16:18:23 * @FilePath: /CasaOS/service/file.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
* @Author: LinkLeong link@icewhale.com * @Date: 2021-09-30 18:18:14 * @LastEditors: LinkLeong * @LastEditTime: 2022-06-02 18:00:57 * @FilePath: /CasaOS/service/rely.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
* @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.
* @Author: LinkLeong link@icewhale.org * @Date: 2022-07-26 11:21:14 * @LastEditors: LinkLeong * @LastEditTime: 2022-08-18 11:16:25 * @FilePath: /CasaOS/service/shares.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
Index ¶
- Variables
- func CheckFileStatus()
- func DockerContainerStats1() error
- func DockerEx()
- func DockerImageRemove(name string) error
- func DockerLog()
- func DockerLogs()
- func DockerNetwork()
- func DockerPull()
- func Exec(container, row, col string) (hr types.HijackedResponse, err error)
- func ExecOpFile()
- func FileOperate(k string)
- func GetCPUThermalZone() string
- func GetDeviceAllIP() []string
- func GetToken() string
- func MsqlExec(container string) error
- func NewReader(ctx context.Context, r io.Reader) io.Reader
- func NewWriter(ctx context.Context, w io.Writer) io.Writer
- func SendMeg()
- type AppService
- type CasaService
- type ConnectionsService
- type DockerService
- type NotifyServer
- type RelyService
- type Repository
- type SharesService
- type SystemService
Constants ¶
This section is empty.
Variables ¶
var Cache *cache.Cache
var ClientCount int = 0
var FileQueue sync.Map
var NewVersionApp map[string]string
var NotifyMsg chan notify.Message
var OpStrArr []string
var SocketRun bool
var WebSocketConns []*websocket.Conn
Functions ¶
func DockerContainerStats1 ¶
func DockerContainerStats1() error
func DockerImageRemove ¶
func DockerLogs ¶
func DockerLogs()
func ExecOpFile ¶ added in v0.3.2
func ExecOpFile()
func FileOperate ¶ added in v0.3.2
func FileOperate(k string)
func GetCPUThermalZone ¶ added in v0.3.8
func GetCPUThermalZone() string
find thermal_zone of cpu. assertions:
- thermal_zone "type" and "temp" are required fields (https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-thermal)
func GetDeviceAllIP ¶ added in v0.2.9
func GetDeviceAllIP() []string
Types ¶
type AppService ¶
type AppService interface {
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 CasaService ¶
type CasaService interface {
GetServerList(index, size, tp, categoryId, key string) (model.ServerAppListCollection, error)
GetServerCategoryList() (list []model.CategoryList, err error)
GetServerAppInfo(id, t string, language string) (model.ServerAppList, error)
GetCasaosVersion() model.Version
AsyncGetServerList() (collection model.ServerAppListCollection, err error)
AsyncGetServerCategoryList() ([]model.CategoryList, error)
}
func NewCasaService ¶ added in v0.2.10
func NewCasaService() CasaService
type ConnectionsService ¶ added in v0.3.5
type ConnectionsService interface {
GetConnectionsList() (connections []model2.ConnectionsDBModel)
GetConnectionByHost(host string) (connections []model2.ConnectionsDBModel)
GetConnectionByID(id string) (connections model2.ConnectionsDBModel)
CreateConnection(connection *model2.ConnectionsDBModel)
DeleteConnection(id string)
UpdateConnection(connection *model2.ConnectionsDBModel)
MountSmaba(username, host, directory, port, mountPoint, password string) string
UnmountSmaba(mountPoint string) string
}
func NewConnectionsService ¶ added in v0.3.5
func NewConnectionsService(db *gorm.DB) ConnectionsService
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 ¶ added in v0.2.3
func NewDockerService() DockerService
type NotifyServer ¶
type NotifyServer interface {
GetLog(id string) model.AppNotify
AddLog(log model.AppNotify)
UpdateLog(log model.AppNotify)
UpdateLogByCustomId(log model.AppNotify)
DelLog(id string)
GetList(c int) (list []model.AppNotify)
MarkRead(id string, state int)
// SendText(m model.AppNotify)
SendUninstallAppBySocket(app notify.Application)
SendNetInfoBySocket(netList []model2.IOCountersStat)
SendCPUInfoBySocket(cpu map[string]interface{})
SendMemInfoBySocket(mem map[string]interface{})
SendFileOperateNotify(nowSend bool)
SendInstallAppBySocket(app notify.Application)
SendAllHardwareStatusBySocket(mem map[string]interface{}, cpu map[string]interface{}, netList []model2.IOCountersStat)
SendStorageBySocket(message notify.StorageMessage)
SendNotify(path string, message map[string]interface{})
SettingSystemTempData(message map[string]interface{})
GetSystemTempMap() map[string]interface{}
}
func NewNotifyService ¶
func NewNotifyService(db *gorm.DB) NotifyServer
type RelyService ¶
type RelyService interface {
Create(rely model2.RelyDBModel)
Delete(id string)
GetInfo(id string) model2.RelyDBModel
}
func NewRelyService ¶
func NewRelyService(db *gorm.DB) RelyService
type Repository ¶
type Repository interface {
App() AppService
//User() UserService
Docker() DockerService
Casa() CasaService
Notify() NotifyServer
Rely() RelyService
System() SystemService
Connections() ConnectionsService
Gateway() external.ManagementService
}
var MyService Repository
func NewService ¶
func NewService(db *gorm.DB, RuntimePath string) Repository
type SharesService ¶ added in v0.3.5
type SharesService interface {
}
func NewSharesService ¶ added in v0.3.5
func NewSharesService(db *gorm.DB) SharesService
type SystemService ¶
type SystemService interface {
UpdateSystemVersion(version string)
GetSystemConfigDebug() []string
GetCasaOSLogs(lineNumber int) string
UpdateAssist()
UpSystemPort(port string)
GetTimeZone() string
UpAppOrderFile(str, id string)
GetAppOrderFile(id string) []byte
GetNet(physics bool) []string
GetNetInfo() []net.IOCountersStat
GetCpuCoreNum() int
GetCpuPercent() float64
GetMemInfo() map[string]interface{}
GetCpuInfo() []cpu.InfoStat
GetDirPath(path string) []model.Path
GetDirPathOne(path string) (m model.Path)
GetNetState(name string) string
GetDiskInfo() *disk.UsageStat
GetSysInfo() host.InfoStat
GetDeviceTree() string
CreateFile(path string) (int, error)
RenameFile(oldF, newF string) (int, error)
MkdirAll(path string) (int, error)
IsServiceRunning(name string) bool
GetCPUTemperature() int
GetCPUPower() map[string]string
GetMacAddress() (string, error)
}
func NewSystemService ¶
func NewSystemService() SystemService
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
* @Author: LinkLeong link@icewhale.org * @Date: 2022-07-26 17:17:57 * @LastEditors: LinkLeong * @LastEditTime: 2022-08-01 17:08:08 * @FilePath: /CasaOS/service/model/o_connections.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.
|
* @Author: LinkLeong link@icewhale.org * @Date: 2022-07-26 17:17:57 * @LastEditors: LinkLeong * @LastEditTime: 2022-08-01 17:08:08 * @FilePath: /CasaOS/service/model/o_connections.go * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved. |