configure

package
v1.0.35 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompareConfigureReply

type CompareConfigureReply struct {
	Type string `json:"type"`
	Key  string `json:"key"`
	Old  string `json:"old"`
	Cur  string `json:"cur"`
}

type CompareConfigureRequest

type CompareConfigureRequest struct {
	ServerId uint32 `json:"serverId"`
	EnvId    uint32 `json:"envId"`
}

type Configure

type Configure struct {
	ktypes.BaseModel
	ServerId    uint32  `json:"serverId"`
	EnvId       uint32  `json:"envId"`
	Content     string  `json:"content"`
	Version     string  `json:"version"`
	Format      string  `json:"format"`
	Description *string `json:"description"`
}

type ListConfigureRequest added in v1.0.35

type ListConfigureRequest struct {
	Page     uint32 `json:"page"`
	PageSize uint32 `json:"pageSize"`
	ServerId uint32 `json:"serverId"`
	EnvId    uint32 `json:"envId"`
}

type Repo

type Repo interface {
	GetConfigure(ctx kratosx.Context, id uint32) (*Configure, error)
	GetConfigureByEnvAndSrv(ctx kratosx.Context, envId, srvId uint32) (*Configure, error)
	ListConfigure(ctx kratosx.Context, req *ListConfigureRequest) ([]*Configure, uint32, error)
	CreateConfigure(ctx kratosx.Context, c *Configure) (uint32, error)
	UpdateConfigure(ctx kratosx.Context, c *Configure) error
	CurrentTemplate(ctx kratosx.Context, srvId uint32) (string, string, error)
	GetServerIdByKeyword(ctx kratosx.Context, keyword string) (uint32, error)
	GetEnvIdByToken(ctx kratosx.Context, token string) (uint32, error)
}

type UseCase

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

func NewUseCase

func NewUseCase(config *conf.Config, repo Repo, factory factory.Factory) *UseCase

func (*UseCase) CompareConfigure

func (u *UseCase) CompareConfigure(ctx kratosx.Context, req *CompareConfigureRequest) ([]*CompareConfigureReply, error)

CompareConfigure 对比配置

func (*UseCase) GetConfigureByEnvAndSrv

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

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

func (*UseCase) ListConfigure added in v1.0.35

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

ListConfigure 获取分页配置信息

func (*UseCase) RenderCurrentTemplate added in v1.0.35

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

func (*UseCase) SendWatcher

func (u *UseCase) SendWatcher(in *Configure)

func (*UseCase) UpdateConfigure

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

UpdateConfigure 更新模配置

func (*UseCase) Watch

type WatcherConfigReplyFunc

type WatcherConfigReplyFunc func(*WatcherConfigureReply) error

type WatcherConfigRequest

type WatcherConfigRequest struct {
	Token  string
	Server string
}

type WatcherConfigureReply

type WatcherConfigureReply struct {
	Format  string `json:"format"`
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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