configure

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 9 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:"server_id"`
	EnvId    uint32 `json:"env_id"`
	Format   string `json:"format"`
	Content  string `json:"content"`
}
type UpdateConfigureRequest struct {
	ServerId    uint32 `json:"server_id"`
	EnvId       uint32 `json:"env_id"`
	Description string `json:"description"`
}

type Configure

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

type Repo

type Repo interface {
	GetConfigure(ctx kratosx.Context, id uint32) (*Configure, error)
	GetConfigureByEnvAndSrv(ctx kratosx.Context, envId, srvId uint32) (*Configure, error)
	PageConfigure(ctx kratosx.Context, options *ktypes.PageOptions) ([]*Configure, uint32, error)
	AddConfigure(ctx kratosx.Context, c *Configure) (uint32, error)
	UpdateConfigure(ctx kratosx.Context, c *Configure) error
}

type UseCase

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

func NewUseCase

func NewUseCase(config *config.Config, repo Repo) *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) PageConfigure

func (u *UseCase) PageConfigure(ctx kratosx.Context, page, pageSize uint32) ([]*Configure, uint32, error)

PageConfigure 获取分页配置信息

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 {
	EnvId    uint32
	ServerId uint32
}

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