launcher

package
v0.0.0-...-a30bb73 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DiskStore stores all REST resources to disk in boltdb and sqlite.
	DiskStore = "disk"
	// BoltStore also stores all REST resources to disk in boltdb and sqlite. Kept for backwards-compatibility.
	BoltStore = "bolt"
	// MemoryStore stores all REST resources in memory (useful for testing).
	MemoryStore = "memory"

	// LogTracing enables tracing via zap logs
	LogTracing = "log"
	// JaegerTracing enables tracing via the Jaeger client library
	JaegerTracing = "jaeger"
)
View Source
const (
	ERROR   = 7
	SUCCESS = 0
)
View Source
const DefaultConfigsFile = "configs"

DefaultConfigsFile stores cli credentials and hosts.

View Source
const DefaultTokenFile = "credentials"

DefaultTokenFile is deprecated, and will be only used for migration.

Variables

This section is empty.

Functions

func BoltFile

func BoltFile() (string, error)

BoltFile returns the path to the bolt file for influxdb

func Fail

func Fail(c *gin.Context)

func FailWithDetailed

func FailWithDetailed(data interface{}, message string, c *gin.Context)

func FailWithMessage

func FailWithMessage(message string, c *gin.Context)

func InfluxDir

func InfluxDir() (string, error)

InfluxDir retrieves the influxdbv2 directory.

func Ok

func Ok(c *gin.Context)

func OkWithData

func OkWithData(data interface{}, c *gin.Context)

func OkWithDetailed

func OkWithDetailed(data interface{}, message string, c *gin.Context)

func OkWithMessage

func OkWithMessage(message string, c *gin.Context)

func Result

func Result(code int, data interface{}, msg string, c *gin.Context)

Types

type AnalyticalStorage

type AnalyticalStorage struct {
	taskmodel.TaskService
	Kvstore *kv.Service
	// contains filtered or unexported fields
}

func NewAnalyticalStorage

func NewAnalyticalStorage(log *zap.Logger, ts taskmodel.TaskService) *AnalyticalStorage

NewAnalyticalStorage creates a new analytical store with access to the necessary systems for storing data and to act as a middleware (deprecated)

type CodesReq

type CodesReq struct {
	Codes []string `json:"codes" form:"codes"`
}

type Empty

type Empty struct{}

type GetAuthorityId

type GetAuthorityId struct {
	AuthorityId uint `json:"authorityId" form:"authorityId"` // 角色ID
}

GetAuthorityId Get role by id structure

type GetById

type GetById struct {
	ID uint64 `json:"id" form:"id"`
}

GetById Find by id structure

func (*GetById) Uint

func (r *GetById) Uint() uint

type IdsReq

type IdsReq struct {
	Ids []int `json:"ids" form:"ids"`
}

type InfluxdOpts

type InfluxdOpts struct {
	AssetsPath  string
	BoltPath    string
	SqLitePath  string
	EnginePath  string
	TracingType string
	StoreType   string
	SecretStore string
	VaultConfig vault.Config

	// Storage options.
	StorageConfig storage.Config

	Viper *viper.Viper

	HardeningEnabled bool

	HttpBindAddress       string
	HttpReadHeaderTimeout time.Duration
	HttpReadTimeout       time.Duration
	HttpWriteTimeout      time.Duration
	HttpIdleTimeout       time.Duration
}

InfluxdOpts captures all arguments for running the InfluxDB server.

func NewOpts

func NewOpts() *InfluxdOpts

NewOpts constructs options with default values.

type Launcher

type Launcher struct {
	KvService *kv.Service

	Executor *executor.Executor

	TSC   taskmodel.TaskService
	Exbot *bot.Exbot
	// contains filtered or unexported fields
}

Launcher represents the main program execution.

func NewLauncher

func NewLauncher() *Launcher

NewLauncher returns a new instance of Launcher with a no-op logger.

func (*Launcher) Done

func (m *Launcher) Done() <-chan struct{}

func (*Launcher) Run

func (m *Launcher) Run(ctx context.Context, opts *InfluxdOpts) (err error)

func (*Launcher) Shutdown

func (m *Launcher) Shutdown(ctx context.Context) error

Shutdown shuts down the HTTP server and waits for all services to clean up.

type PageInfo

type PageInfo struct {
	Page     int    `json:"page" form:"page"`         // 页码
	PageSize int    `json:"pageSize" form:"pageSize"` // 每页大小
	Keyword  string `json:"keyword" form:"keyword"`   //关键字
}

PageInfo Paging common input parameter structure

type Response

type Response struct {
	Code int         `json:"code"`
	Data interface{} `json:"data"`
	Msg  string      `json:"msg"`
}

type ResponseInfo

type ResponseInfo struct {
	List  interface{} `json:"list"`
	Total int         `json:"total" form:"total"` // 页码

}

Jump to

Keyboard shortcuts

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