admin

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	SuccessCode = 200
	FailCode    = 500
)
View Source
const (
	EmptyString = ""

	UrlRegister       = "api/registry"
	UrlRegistryRemove = "api/registryRemove"
	UrlCallback       = "api/callback"

	XxlJobAccessToken = "XXL-JOB-ACCESS-TOKEN"
)
View Source
const (
	EXECUTOR = iota
	ADMIN
)

RegistryConfig

View Source
const LoopFrequency = time.Second * 30

Variables

This section is empty.

Functions

func GetGroupName

func GetGroupName(groupId int) string

Types

type AdmApi

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

func GetClient

func GetClient() *AdmApi

func NewAdmApi

func NewAdmApi() *AdmApi

func (*AdmApi) Callback

func (adm *AdmApi) Callback(call []HandleCallbackParams)

func (*AdmApi) Register

func (adm *AdmApi) Register()

func (*AdmApi) RegistryRemove

func (adm *AdmApi) RegistryRemove()

func (*AdmApi) SetOpt

func (adm *AdmApi) SetOpt(opts ...Option)

type HandleCallbackParams

type HandleCallbackParams struct {
	LogId      int64  `json:"logId"`
	LogDateTim int64  `json:"logDateTim"`
	HandleCode int    `json:"handleCode"`
	HandleMsg  string `json:"handleMsg"`
}

type Option

type Option func(o *Options)

func SetAccessToken

func SetAccessToken(accessToken string) Option

func SetAdmAddresses

func SetAdmAddresses(addresses []string) Option

func SetRegistryGroup

func SetRegistryGroup(registryGroup string) Option

func SetRegistryKey

func SetRegistryKey(registryKey string) Option

func SetRegistryValue

func SetRegistryValue(registryValue string) Option

func SetTimeout

func SetTimeout(timeout time.Duration) Option

type Options

type Options struct {
	AdmAddresses  []string
	AccessToken   string
	Timeout       time.Duration
	RegistryGroup string
	RegistryKey   string
	RegistryValue string
}

type Registry

type Registry struct {
	RegistryGroup string `json:"registryGroup"`
	RegistryKey   string `json:"registryKey"`
	RegistryValue string `json:"registryValue"`
}

type Resp

type Resp struct {
	Code    int         `json:"code"`
	Msg     string      `json:"msg"`
	Content interface{} `json:"content"`
}

Jump to

Keyboard shortcuts

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