service

package
v1.4.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

* @Author: LinkLeong link@icewhale.com * @Date: 2022-03-18 11:40:55 * @LastEditors: LinkLeong * @LastEditTime: 2022-07-12 10:05:37 * @Description: * @Website: https://www.casaos.io * Copyright (c) 2022 by icewhale, All Rights Reserved.

Index

Constants

This section is empty.

Variables

View Source
var (
	APICorePrefix = "/api/v3/core"
)
View Source
var UserRegisterHash = make(map[string]string)

Functions

This section is empty.

Types

type AuthentikService

type AuthentikService interface {
	GetUserInfo(accessToken string, baseURL string) (model2.AuthentikUser, error)
	GetUserApp(accessToken string, baseURL string) (model2.AuthentikApplication, error)
	CreateSettings(m model2.AuthentikCredentialsDBModel) model2.AuthentikCredentialsDBModel
	UpdateSettings(m model2.AuthentikCredentialsDBModel) (model2.AuthentikCredentialsDBModel, error)
	GetSettings() (model2.AuthentikCredentialsDBModel, error)
	ValidateToken(clientId string, clientSecret string, accessToken string, baseURL string) (model2.AuthentikToken, error)
	HealthCheck(baseURL string) (string, error)
}

func NewAuthentikService

func NewAuthentikService(db *gorm.DB) AuthentikService

type EventService

type EventService interface {
	CreateEvent(m model.EventModel) model.EventModel
	GetEvents() (list []model.EventModel)
	GetEventByUUID(uuid string) (m model.EventModel)
	DeleteEvent(uuid string)
	DeleteEventBySerial(serial string)
}

func NewEventService

func NewEventService(db *gorm.DB) EventService

type OMVService

type OMVService interface {
	LoginSession(userName string, password string) (string, []*http.Cookie)
	Logout(sessionID string) (string, error)
	GetUser(username string, sessionID string) (string, error)
	AuthUser(username string, password string, sessionID string) (string, error)
	SetUser(m model.UserDBModel) model.UserDBModel
	ApplyChange()
}

func NewOMVService

func NewOMVService() OMVService

type OnePanelService

type OnePanelService interface {
	Login(m model2.OnePanelCredentials, baseURL string) (model2.LoginResponse, []*http.Cookie, error)
	Logout(m model2.OnePanelCredentials, baseURL string) (model2.LogoutResponse, error)
	HealthCheck(baseURL string) (string, error)
	SearchInstalledApp(p model2.InstalledAppRequest, baseURL string) (model2.InstalledAppResponse, error)
	// InstallApp()
	SearchWebsite(m model2.SearchWebsiteRequest, baseUrl string, headers map[string]string) (model2.SearchWebsiteResponse, error)
	CreateWebsite(m model2.CreateWebsiteRequest, baseUrl string, headers map[string]string) (model2.GenericResponse, error)
	DeleteWebsite(m model2.DeleteWebsiteRequest, baseUrl string, headers map[string]string) (model2.GenericResponse, error)
	GetProxyWebsite(m model2.ProxyWebsiteRequest, baseUrl string, headers map[string]string) (model2.ProxyWebsiteResponse, error)
	UpdateProxyWebsite(m model2.ProxyDetail, baseUrl string, headers map[string]string) (model2.GenericResponse, error)
	AcmeAccountSearch(m model2.AcmeSearchRequest, baseUrl string, headers map[string]string) (model2.AcmeSearchResponse, error)
	ApplyWebsiteSSl(m model2.CreateSSLRequest, baseUrl string, headers map[string]string) (model2.CreateSSLResponse, error)
	SearchWebsiteSSl(m model2.SearchSSLRequest, baseUrl string, headers map[string]string) (model2.SearchSSLResponse, error)
}

func NewOnePanelService

func NewOnePanelService() OnePanelService

type Repository

type Repository interface {
	Gateway() external.ManagementService
	User() UserService
	MessageBus() *message_bus.ClientWithResponses
	Event() EventService
	OMV() OMVService
	Authentik() AuthentikService
	OnePanel() OnePanelService
}
var MyService Repository

func NewService

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

type UserService

type UserService interface {
	UpLoadFile(file multipart.File, name string) error
	CreateUser(m model.UserDBModel) model.UserDBModel
	GetUserCount() (userCount int64)
	UpdateUser(m model.UserDBModel)
	UpdateUserPassword(m model.UserDBModel)
	GetUserInfoById(id string) (m model.UserDBModel)
	GetUserAllInfoById(id string) (m model.UserDBModel)
	GetUserAllInfoByName(userName string) (m model.UserDBModel)
	DeleteUserById(id string)
	DeleteAllUser()
	GetUserInfoByUserName(userName string) (m model.UserDBModel)
	GetAllUserName() (list []model.UserDBModel)
	GetKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey)
}

func NewUserService

func NewUserService(db *gorm.DB) UserService

获取用户Service

Directories

Path Synopsis
* @Author: LinkLeong link@icewhale.com * @Date: 2022-05-13 18:15:46 * @LastEditors: LinkLeong * @LastEditTime: 2022-07-11 17:57:00 * @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-11 17:57:00 * @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