env

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	types.BaseModel
	Keyword     string `json:"keyword"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Token       string `json:"token,omitempty"`
	Status      *bool  `json:"status"`
}

type Repo

type Repo interface {
	GetEnv(ctx kratosx.Context, id uint32) (*Env, error)
	GetEnvByKeyword(ctx kratosx.Context, keyword string) (*Env, error)
	GetEnvByToken(ctx kratosx.Context, keyword string) (*Env, error)

	// GetEnvByIds(ctx kratosx.Context, ids []uint32) ([]*Env, error)
	AllEnv(ctx kratosx.Context, scope ...string) ([]*Env, error)

	AddEnv(ctx kratosx.Context, c *Env) (uint32, error)
	UpdateEnv(ctx kratosx.Context, c *Env) error
	DeleteEnv(ctx kratosx.Context, uint322 uint32) error
}

type UseCase

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

func NewUseCase

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

func (*UseCase) AddEnv

func (e *UseCase) AddEnv(ctx kratosx.Context, env *Env) (uint32, error)

AddEnv 新建环境

func (*UseCase) AllEnv

func (e *UseCase) AllEnv(ctx kratosx.Context) ([]*Env, error)

AllEnv 查询所有环境

func (*UseCase) DeleteEnv

func (e *UseCase) DeleteEnv(ctx kratosx.Context, id uint32) error

DeleteEnv 删除指定id的环境

func (*UseCase) GetEnv

func (e *UseCase) GetEnv(ctx kratosx.Context, id uint32) (*Env, error)

GetEnv 查询指定的服务

func (*UseCase) GetEnvByKeyword

func (e *UseCase) GetEnvByKeyword(ctx kratosx.Context, keyword string) (*Env, error)

GetEnvByKeyword 通过关键词查找指定环境

func (*UseCase) GetEnvByToken

func (e *UseCase) GetEnvByToken(ctx kratosx.Context, token string) (*Env, error)

GetEnvByToken 通过token查找指定环境

func (*UseCase) ResetEnvToken

func (e *UseCase) ResetEnvToken(ctx kratosx.Context, id uint32) (string, error)

ResetEnvToken 重置环境token

func (*UseCase) UpdateEnv

func (e *UseCase) UpdateEnv(ctx kratosx.Context, env *Env) error

UpdateEnv 更新环境

Jump to

Keyboard shortcuts

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