cmd

package
v0.0.0-...-c91e57f Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSubCmd

func AddSubCmd(c *cobra.Command)

func Run

func Run() error

Types

type App

type App struct {
	// Names    application name
	Names []string `yaml:"names"`
	Env   string   `yaml:"env"`
	Nacos Nacos    `yaml:"nacos"`
	Keep  []Meta   `yaml:"keep"`
}

type Config

type Config struct {
	App []App `yaml:"service"`
	Log Log   `yaml:"log"`
}

type Guber

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

func NewGuber

func NewGuber(cfg *Config) (*Guber, error)

func NewServer

func NewServer(sf *serverFlags) (*Guber, error)

func (*Guber) CloseWithErr

func (g *Guber) CloseWithErr(err error)

CloseWithErr is a shortcut for m.sc.SendCloseSignal

func (*Guber) GetSafeClose

func (g *Guber) GetSafeClose() *safe_close.SafeClose

func (*Guber) Logger

func (g *Guber) Logger() *zap.Logger

Logger returns a non-nil logger.

func (*Guber) Status

func (g *Guber) Status() string

Status prints the information of the nacos and application.

type Log

type Log struct {
	Level string `yaml:"level"`
}

type Meta

type Meta struct {
	Key string `yaml:"key"`
	Val string `yaml:"value"`
}

type Nacos

type Nacos struct {
	Addr     string `yaml:"addr"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type NacosClient

type NacosClient struct {
	NacosConfig *Nacos
	AccessToken string
	TokenTtl    int64
	LastLogin   int64
	Cache       map[string][]string
	Env         string
}

func NewNacosClient

func NewNacosClient(nacosConfig *Nacos, env string) *NacosClient

func (*NacosClient) Login

func (n *NacosClient) Login() error

curl -X POST '127.0.0.1:8848/nacos/v1/auth/login' -d 'username=nacos&password=nacos' login

func (*NacosClient) Run

func (n *NacosClient) Run(g *Guber) error

Jump to

Keyboard shortcuts

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