service

package
v0.0.0-...-734a412 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Business

type Business struct {
	// contains filtered or unexported fields
}

func NewBusiness

func NewBusiness(
	conf *conf.Config,
	repo repository.Business,
	permission repository.Permission,
) *Business

func (*Business) CreateBusiness

func (u *Business) CreateBusiness(ctx kratosx.Context, req *entity.Business) (uint32, error)

CreateBusiness 创建业务配置信息

func (*Business) DeleteBusiness

func (u *Business) DeleteBusiness(ctx kratosx.Context, id uint32) error

DeleteBusiness 删除业务配置信息

func (*Business) ListBusiness

func (u *Business) ListBusiness(ctx kratosx.Context, req *types.ListBusinessRequest) ([]*entity.Business, uint32, error)

ListBusiness 获取业务配置信息列表

func (*Business) ListBusinessValue

func (u *Business) ListBusinessValue(ctx kratosx.Context, bid uint32) ([]*entity.BusinessValue, error)

ListBusinessValue 获取业务配置值信息列表

func (*Business) UpdateBusiness

func (u *Business) UpdateBusiness(ctx kratosx.Context, req *entity.Business) error

UpdateBusiness 更新业务配置信息

func (*Business) UpdateBusinessValue

func (u *Business) UpdateBusinessValue(ctx kratosx.Context, list []*entity.BusinessValue) error

UpdateBusinessValue 更新业务配置值信息

type Configure

type Configure struct {
	// contains filtered or unexported fields
}

func NewConfigure

func NewConfigure(
	conf *conf.Config,
	repo repository.Configure,
	server repository.Server,
	env repository.Env,
	business repository.Business,
	resource repository.Resource,
	template repository.Template,
	permission repository.Permission,
) *Configure

func (*Configure) CompareConfigure

CompareConfigure 对比配置

func (*Configure) GetConfigureByEnvAndSrv

func (u *Configure) GetConfigureByEnvAndSrv(ctx kratosx.Context, envId, srvId uint32) (*entity.Configure, error)

GetConfigureByEnvAndSrv 获取指定标识的配置信息

func (*Configure) ListConfigure

func (u *Configure) ListConfigure(ctx kratosx.Context, req *types.ListConfigureRequest) ([]*entity.Configure, uint32, error)

ListConfigure 获取分页配置信息

func (*Configure) RenderCurrentTemplate

func (u *Configure) RenderCurrentTemplate(ctx kratosx.Context, srvId, envId uint32) (string, string, error)

func (*Configure) SendWatcher

func (u *Configure) SendWatcher(ctx kratosx.Context, envId uint32, srvId uint32) error

func (*Configure) UpdateConfigure

func (u *Configure) UpdateConfigure(ctx kratosx.Context, req *entity.Configure) error

UpdateConfigure 更新模配置

func (*Configure) Watch

type Env

type Env struct {
	// contains filtered or unexported fields
}

func NewEnv

func NewEnv(
	conf *conf.Config,
	repo repository.Env,
	permission repository.Permission,
) *Env

func (*Env) CreateEnv

func (u *Env) CreateEnv(ctx kratosx.Context, req *entity.Env) (uint32, error)

CreateEnv 创建环境信息

func (*Env) DeleteEnv

func (u *Env) DeleteEnv(ctx kratosx.Context, id uint32) error

DeleteEnv 删除环境信息

func (*Env) GetEnvToken

func (u *Env) GetEnvToken(ctx kratosx.Context, id uint32) (string, error)

GetEnvToken 获取环境token

func (*Env) ListEnv

func (u *Env) ListEnv(ctx kratosx.Context, req *types.ListEnvRequest) ([]*entity.Env, uint32, error)

ListEnv 获取环境信息列表

func (*Env) UpdateEnv

func (u *Env) UpdateEnv(ctx kratosx.Context, req *entity.Env) error

UpdateEnv 更新环境信息

type Password

type Password struct {
	Password string `json:"password"`
	Time     int64  `json:"time"`
}

type Resource

type Resource struct {
	// contains filtered or unexported fields
}

func NewResource

func NewResource(
	conf *conf.Config,
	repo repository.Resource,
	permission repository.Permission,
) *Resource

func (*Resource) CreateResource

func (u *Resource) CreateResource(ctx kratosx.Context, req *entity.Resource) (uint32, error)

CreateResource 创建资源配置信息

func (*Resource) DeleteResource

func (u *Resource) DeleteResource(ctx kratosx.Context, id uint32) error

DeleteResource 删除资源配置信息

func (*Resource) GetResource

func (u *Resource) GetResource(ctx kratosx.Context, id uint32) (*entity.Resource, error)

GetResource 获取指定的资源配置信息

func (*Resource) GetResourceByKeyword

func (u *Resource) GetResourceByKeyword(ctx kratosx.Context, keyword string) (*entity.Resource, error)

GetResourceByKeyword 获取指定的资源配置信息

func (*Resource) ListResource

func (u *Resource) ListResource(ctx kratosx.Context, req *types.ListResourceRequest) ([]*entity.Resource, uint32, error)

ListResource 获取资源配置信息列表

func (*Resource) ListResourceValue

func (u *Resource) ListResourceValue(ctx kratosx.Context, rid uint32) ([]*entity.ResourceValue, error)

ListResourceValue 获取业务配置值信息列表

func (*Resource) UpdateResource

func (u *Resource) UpdateResource(ctx kratosx.Context, req *entity.Resource) error

UpdateResource 更新资源配置信息

func (*Resource) UpdateResourceValue

func (u *Resource) UpdateResourceValue(ctx kratosx.Context, list []*entity.ResourceValue) error

UpdateResourceValue 更新业务配置值信息

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	conf *conf.Config,
	repo repository.Server,
	permission repository.Permission,
) *Server

func (*Server) CreateServer

func (u *Server) CreateServer(ctx kratosx.Context, req *entity.Server) (uint32, error)

CreateServer 创建服务信息

func (*Server) DeleteServer

func (u *Server) DeleteServer(ctx kratosx.Context, id uint32) error

DeleteServer 删除服务信息

func (*Server) ListServer

func (u *Server) ListServer(ctx kratosx.Context, req *types.ListServerRequest) ([]*entity.Server, uint32, error)

ListServer 获取服务信息列表

func (*Server) UpdateServer

func (u *Server) UpdateServer(ctx kratosx.Context, req *entity.Server) error

UpdateServer 更新服务信息

type Template

type Template struct {
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate(
	conf *conf.Config,
	repo repository.Template,
	business repository.Business,
	resource repository.Resource,
	permission repository.Permission,
) *Template

func (*Template) CompareTemplate

CompareTemplate 对比变更细节

func (*Template) CreateTemplate

func (t *Template) CreateTemplate(ctx kratosx.Context, template *entity.Template) (uint32, error)

CreateTemplate 添加模板信息

func (*Template) CurrentTemplate

func (t *Template) CurrentTemplate(ctx kratosx.Context, srvId uint32) (*entity.Template, error)

CurrentTemplate 获取当前版本的配置信息

func (*Template) DeleteUpdateTemplate

func (t *Template) DeleteUpdateTemplate(ctx kratosx.Context, id uint32) error

DeleteUpdateTemplate 删除模板信息

func (*Template) GetTemplate

func (t *Template) GetTemplate(ctx kratosx.Context, id uint32) (*entity.Template, error)

GetTemplate 获取指定模板信息

func (*Template) ListTemplate

func (t *Template) ListTemplate(ctx kratosx.Context, req *types.ListTemplateRequest) ([]*entity.Template, uint32, error)

ListTemplate 获取分页模板信息

func (*Template) PreviewCurrentTemplate

PreviewCurrentTemplate 预览当前配置

func (*Template) PreviewTemplate

PreviewTemplate 预览配置

func (*Template) SwitchTemplate

func (t *Template) SwitchTemplate(ctx kratosx.Context, srvId, tpId uint32) error

SwitchTemplate 切换指定版本信息

func (*Template) UpdateTemplate

func (t *Template) UpdateTemplate(ctx kratosx.Context, req *entity.Template) error

UpdateTemplate 更新模板信息

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(conf *conf.Config) *User

func (*User) Login

func (us *User) Login(ctx kratosx.Context, username, password string) (string, error)

Login 用户登录

func (*User) RefreshToken

func (us *User) RefreshToken(ctx kratosx.Context) (string, error)

RefreshToken 刷新用户token

Jump to

Keyboard shortcuts

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