app

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
View Source
View Source
const MainUsage = `` /* 339-byte string literal not displayed */
View Source
const RunUsage = `` /* 175-byte string literal not displayed */
View Source
View Source
View Source
View Source
const TSSERVER = `` /* 505-byte string literal not displayed */

Variables

View Source
var (
	Version   string
	GitCommit string
	GitBranch string
	BuildTime string
)

Version information, the value is set by the build script

Functions

func CreateSerfInstance

func CreateSerfInstance(conf *serf.Config, clock uint64, members []string, preNodes []*serf.PreviousNode) (*serf.Serf, error)

func FullVersion added in v1.3.0

func FullVersion(app string) string

FullVersion returns the full version string.

func HideQueryPassword

func HideQueryPassword(url string) string

func InitParse added in v1.0.1

func InitParse()

InitParse inits the command line parse flogs

func LogStarting added in v1.1.0

func LogStarting(name string, info *ServerInfo)

func RemovePIDFile

func RemovePIDFile(pidfile string)

func Run added in v1.1.0

func Run(args []string, commands ...*Command)

func SetStatsResponse added in v1.0.0

func SetStatsResponse(pusher *statisticsPusher.StatisticsPusher, w http.ResponseWriter, r *http.Request)

func WritePIDFile

func WritePIDFile(pidfile string) error

Types

type Command

type Command struct {
	Usage         string
	Pidfile       string
	Logger        *logger.Logger
	Command       *cobra.Command
	Info          ServerInfo
	Version       string
	Server        Server
	Config        config.Config
	NewServerFunc func(config.Config, ServerInfo, *logger.Logger) (Server, error)

	AfterOpen func()
}

Command represents the command executed by "ts-xxx run".

func NewCommand

func NewCommand() *Command

func (*Command) Close

func (cmd *Command) Close() error

func (*Command) InitConfig

func (cmd *Command) InitConfig(conf config.Config, path string) error

func (*Command) Run

func (cmd *Command) Run(args ...string) error

type Options

type Options struct {
	ConfigPath string
	PIDFile    string
	Join       string
	Hostname   string
}

Options represents the command line options that can be parsed.

func ParseFlags

func ParseFlags(usage func(), args ...string) (Options, error)

type ProactiveManager added in v1.1.0

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

func NewProactiveManager added in v1.1.0

func NewProactiveManager() *ProactiveManager

func (*ProactiveManager) Close added in v1.1.0

func (pm *ProactiveManager) Close() error

func (*ProactiveManager) GetQueryList added in v1.1.0

func (pm *ProactiveManager) GetQueryList(cnt int) []uint64

func (*ProactiveManager) KillQuery added in v1.1.0

func (pm *ProactiveManager) KillQuery(id uint64)

func (*ProactiveManager) Open added in v1.1.0

func (pm *ProactiveManager) Open() error

func (*ProactiveManager) SetInspectInterval added in v1.1.0

func (pm *ProactiveManager) SetInspectInterval(interval time.Duration)

func (*ProactiveManager) WithLogger added in v1.1.0

func (pm *ProactiveManager) WithLogger(logger *logger.Logger)

type Server

type Server interface {
	Open() error
	Close() error
	Err() <-chan error
}

type ServerInfo added in v1.1.0

type ServerInfo struct {
	App       config.App
	Version   string
	Commit    string
	Branch    string
	BuildTime string
}

func (*ServerInfo) FullVersion added in v1.1.0

func (si *ServerInfo) FullVersion() string

func (*ServerInfo) StatVersion added in v1.3.0

func (si *ServerInfo) StatVersion() string

Jump to

Keyboard shortcuts

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