admin

package
v0.0.0-...-bca9f57 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(config Config) (*common.HTTPHandler, error)

NewService returns a new admin API service. All of the fields in [config] must be set.

Types

type Admin

type Admin struct {
	Config
	// contains filtered or unexported fields
}

Admin is the API service for node admin management

func (*Admin) Alias

func (service *Admin) Alias(_ *http.Request, args *AliasArgs, reply *api.SuccessResponse) error

Alias attempts to alias an HTTP endpoint to a new name

func (*Admin) AliasChain

func (service *Admin) AliasChain(_ *http.Request, args *AliasChainArgs, reply *api.SuccessResponse) error

AliasChain attempts to alias a chain to a new name

func (*Admin) GetChainAliases

func (service *Admin) GetChainAliases(_ *http.Request, args *GetChainAliasesArgs, reply *GetChainAliasesReply) error

GetChainAliases returns the aliases of the chain

func (*Admin) GetConfig

func (service *Admin) GetConfig(_ *http.Request, args *struct{}, reply *interface{}) error

GetConfig returns the config that the node was started with.

func (*Admin) GetLoggerLevel

func (service *Admin) GetLoggerLevel(_ *http.Request, args *GetLoggerLevelArgs, reply *GetLoggerLevelReply) error

GetLogLevel returns the log level and display level of all loggers.

func (*Admin) LockProfile

func (service *Admin) LockProfile(_ *http.Request, _ *struct{}, reply *api.SuccessResponse) error

LockProfile runs a mutex profile writing to the specified file

func (*Admin) MemoryProfile

func (service *Admin) MemoryProfile(_ *http.Request, _ *struct{}, reply *api.SuccessResponse) error

MemoryProfile runs a memory profile writing to the specified file

func (*Admin) SetLoggerLevel

func (service *Admin) SetLoggerLevel(_ *http.Request, args *SetLoggerLevelArgs, reply *api.SuccessResponse) error

SetLoggerLevel sets the log level and/or display level for loggers. If len([args.LoggerName]) == 0, sets the log/display level of all loggers. Otherwise, sets the log/display level of the loggers named in that argument. Sets the log level of these loggers to args.LogLevel. If args.LogLevel == nil, doesn't set the log level of these loggers. If args.LogLevel != nil, must be a valid string representation of a log level. Sets the display level of these loggers to args.LogLevel. If args.DisplayLevel == nil, doesn't set the display level of these loggers. If args.DisplayLevel != nil, must be a valid string representation of a log level.

func (*Admin) Stacktrace

func (service *Admin) Stacktrace(_ *http.Request, _ *struct{}, reply *api.SuccessResponse) error

Stacktrace returns the current global stacktrace

func (*Admin) StartCPUProfiler

func (service *Admin) StartCPUProfiler(_ *http.Request, _ *struct{}, reply *api.SuccessResponse) error

StartCPUProfiler starts a cpu profile writing to the specified file

func (*Admin) StopCPUProfiler

func (service *Admin) StopCPUProfiler(_ *http.Request, _ *struct{}, reply *api.SuccessResponse) error

StopCPUProfiler stops the cpu profile

type AliasArgs

type AliasArgs struct {
	Endpoint string `json:"endpoint"`
	Alias    string `json:"alias"`
}

AliasArgs are the arguments for calling Alias

type AliasChainArgs

type AliasChainArgs struct {
	Chain string `json:"chain"`
	Alias string `json:"alias"`
}

AliasChainArgs are the arguments for calling AliasChain

type Client

type Client interface {
	StartCPUProfiler() (bool, error)
	StopCPUProfiler() (bool, error)
	MemoryProfile() (bool, error)
	LockProfile() (bool, error)
	Alias(endpoint string, alias string) (bool, error)
	AliasChain(chainID string, alias string) (bool, error)
	GetChainAliases(chainID string) ([]string, error)
	Stacktrace() (bool, error)
}

Client interface for the Avalanche Platform Info API Endpoint

func NewClient

func NewClient(uri string, requestTimeout time.Duration) Client

NewClient returns a new Info API Client

type Config

type Config struct {
	Log          logging.Logger
	ProfileDir   string
	LogFactory   logging.Factory
	NodeConfig   interface{}
	ChainManager chains.Manager
	HTTPServer   *server.Server
}

type GetChainAliasesArgs

type GetChainAliasesArgs struct {
	Chain string `json:"chain"`
}

GetChainAliasesArgs are the arguments for calling GetChainAliases

type GetChainAliasesReply

type GetChainAliasesReply struct {
	Aliases []string `json:"aliases"`
}

GetChainAliasesReply are the aliases of the given chain

type GetLoggerLevelArgs

type GetLoggerLevelArgs struct {
	LoggerName string `json:"loggerName"`
}

See GetLoggerLevel

type GetLoggerLevelReply

type GetLoggerLevelReply struct {
	LoggerLevels map[string]LogAndDisplayLevels `json:"loggerLevels"`
}

See GetLoggerLevel

type LogAndDisplayLevels

type LogAndDisplayLevels struct {
	LogLevel     logging.Level `json:"logLevel"`
	DisplayLevel logging.Level `json:"displayLevel"`
}

type SetLoggerLevelArgs

type SetLoggerLevelArgs struct {
	LoggerName   string         `json:"loggerName"`
	LogLevel     *logging.Level `json:"logLevel"`
	DisplayLevel *logging.Level `json:"displayLevel"`
}

See SetLoggerLevel

Jump to

Keyboard shortcuts

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