app

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Copyright 2023 Huawei Cloud Computing Technologies Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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 = `` /* 517-byte string literal not displayed */
View Source
const VERSION = `openGemini version info:
%s: %s
git: %s %s
os: %s
arch: %s
`

Variables

This section is empty.

Functions

func CreateSerfInstance

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

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)
}

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 (i *ServerInfo) FullVersion() string

Jump to

Keyboard shortcuts

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