Help us shape the future of Go! Take the 2026 Go Developer Survey

admin

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: BSD-3-Clause Imports: 9 Imported by: 2

Documentation

Overview

Operating a node.

THREE SHAPES HERE ARE AN OBJECT ON THE JSON WIRE AND A LIST IN GO — the logger levels, the installed VMs, and what a reload found. A ZAP field is an offset and a map has no order to give one, so a reply carrying a map cannot cross between two processes at all. Each list is ordered by the key it was an object of; the JSON is unchanged.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliasArgs

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

AliasArgs are the arguments for calling Alias.

func (*AliasArgs) MarshalZAP added in v1.1.13

func (x *AliasArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes AliasArgs from constant offsets.

func (*AliasArgs) UnmarshalZAP added in v1.1.13

func (x *AliasArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads AliasArgs out of the buffer that arrived.

type AliasChainArgs

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

AliasChainArgs are the arguments for calling AliasChain.

func (*AliasChainArgs) MarshalZAP added in v1.1.13

func (x *AliasChainArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes AliasChainArgs from constant offsets.

func (*AliasChainArgs) UnmarshalZAP added in v1.1.13

func (x *AliasChainArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads AliasChainArgs out of the buffer that arrived.

type DBGetArgs

type DBGetArgs struct {
	Key string `json:"key"`
}

DBGetArgs are the arguments for DBGet.

func (*DBGetArgs) MarshalZAP added in v1.1.13

func (x *DBGetArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes DBGetArgs from constant offsets.

func (*DBGetArgs) UnmarshalZAP added in v1.1.13

func (x *DBGetArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads DBGetArgs out of the buffer that arrived.

type DBGetReply

type DBGetReply struct {
	Value string `json:"value"`
}

DBGetReply is the reply for DBGet.

func (*DBGetReply) MarshalZAP added in v1.1.13

func (x *DBGetReply) MarshalZAP() ([]byte, error)

MarshalZAP writes DBGetReply from constant offsets.

func (*DBGetReply) UnmarshalZAP added in v1.1.13

func (x *DBGetReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads DBGetReply out of the buffer that arrived.

type EmptyReply

type EmptyReply = types.EmptyReply

EmptyReply is an alias to common empty reply.

type FailedVM added in v1.1.14

type FailedVM struct {
	// VM is the VM's id, the key it appears under on the JSON wire.
	VM ids.ID `json:"vm"`
	// Error is what stopped it loading.
	Error string `json:"error"`
}

FailedVM is one VM a reload could not bring in, and why.

func (*FailedVM) MarshalZAP added in v1.1.14

func (x *FailedVM) MarshalZAP() ([]byte, error)

MarshalZAP writes FailedVM from constant offsets.

func (*FailedVM) UnmarshalZAP added in v1.1.14

func (x *FailedVM) UnmarshalZAP(data []byte) error

UnmarshalZAP reads FailedVM out of the buffer that arrived.

type FailedVMs added in v1.1.14

type FailedVMs []FailedVM

FailedVMs are the VMs a reload could not bring in: an object keyed by VM id on the JSON wire, a list ordered by that id here.

func (FailedVMs) MarshalJSON added in v1.1.14

func (f FailedVMs) MarshalJSON() ([]byte, error)

func (*FailedVMs) UnmarshalJSON added in v1.1.14

func (f *FailedVMs) UnmarshalJSON(b []byte) error

type GetChainAliasesArgs

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

GetChainAliasesArgs are the arguments for calling GetChainAliases.

func (*GetChainAliasesArgs) MarshalZAP added in v1.1.13

func (x *GetChainAliasesArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes GetChainAliasesArgs from constant offsets.

func (*GetChainAliasesArgs) UnmarshalZAP added in v1.1.13

func (x *GetChainAliasesArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetChainAliasesArgs out of the buffer that arrived.

type GetChainAliasesReply

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

GetChainAliasesReply are the aliases of the given chain.

func (*GetChainAliasesReply) MarshalZAP added in v1.1.13

func (x *GetChainAliasesReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetChainAliasesReply from constant offsets.

func (*GetChainAliasesReply) UnmarshalZAP added in v1.1.13

func (x *GetChainAliasesReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetChainAliasesReply out of the buffer that arrived.

type GetLoggerLevelArgs

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

GetLoggerLevelArgs are the arguments for getting logger levels.

func (*GetLoggerLevelArgs) MarshalZAP added in v1.1.13

func (x *GetLoggerLevelArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes GetLoggerLevelArgs from constant offsets.

func (*GetLoggerLevelArgs) UnmarshalZAP added in v1.1.13

func (x *GetLoggerLevelArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetLoggerLevelArgs out of the buffer that arrived.

type GetTrackedChainsReply

type GetTrackedChainsReply struct {
	TrackedChains []string `json:"trackedChains"`
}

GetTrackedChainsReply is the response for GetTrackedChains.

func (*GetTrackedChainsReply) MarshalZAP added in v1.1.13

func (x *GetTrackedChainsReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetTrackedChainsReply from constant offsets.

func (*GetTrackedChainsReply) UnmarshalZAP added in v1.1.13

func (x *GetTrackedChainsReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetTrackedChainsReply out of the buffer that arrived.

type InstalledVMs added in v1.1.14

type InstalledVMs []VMInfo

InstalledVMs are the VMs on a node: an object keyed by VM id on the JSON wire, a list ordered by that id here. The id is on the element too — it is VMInfo.ID — so the key is the element's own name rather than a second one.

func (InstalledVMs) MarshalJSON added in v1.1.14

func (v InstalledVMs) MarshalJSON() ([]byte, error)

func (*InstalledVMs) UnmarshalJSON added in v1.1.14

func (v *InstalledVMs) UnmarshalJSON(b []byte) error

type ListVMsReply

type ListVMsReply struct {
	VMs InstalledVMs `json:"vms"`
}

ListVMsReply contains the response for ListVMs.

func (*ListVMsReply) MarshalZAP added in v1.1.14

func (x *ListVMsReply) MarshalZAP() ([]byte, error)

MarshalZAP writes ListVMsReply from constant offsets.

func (*ListVMsReply) UnmarshalZAP added in v1.1.14

func (x *ListVMsReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads ListVMsReply out of the buffer that arrived.

type LoadArgs

type LoadArgs struct {
	Path string `json:"path"`
}

LoadArgs are the arguments for Load.

func (*LoadArgs) MarshalZAP added in v1.1.13

func (x *LoadArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes LoadArgs from constant offsets.

func (*LoadArgs) UnmarshalZAP added in v1.1.13

func (x *LoadArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LoadArgs out of the buffer that arrived.

type LoadVMsReply

type LoadVMsReply struct {
	NewVMs        LoadedVMs `json:"newVMs"`
	FailedVMs     FailedVMs `json:"failedVMs"`
	ChainsRetried int       `json:"chainsRetried"`
}

LoadVMsReply contains the response for LoadVMs.

func (*LoadVMsReply) MarshalZAP added in v1.1.14

func (x *LoadVMsReply) MarshalZAP() ([]byte, error)

MarshalZAP writes LoadVMsReply from constant offsets.

func (*LoadVMsReply) UnmarshalZAP added in v1.1.14

func (x *LoadVMsReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LoadVMsReply out of the buffer that arrived.

type LoadedVM added in v1.1.14

type LoadedVM struct {
	// VM is the VM's id, the key it appears under on the JSON wire.
	VM ids.ID `json:"vm"`
	// Aliases are the names it also answers to.
	Aliases []string `json:"aliases"`
}

LoadedVM is one VM a reload brought in and the names it answers to.

func (*LoadedVM) MarshalZAP added in v1.1.14

func (x *LoadedVM) MarshalZAP() ([]byte, error)

MarshalZAP writes LoadedVM from constant offsets.

func (*LoadedVM) UnmarshalZAP added in v1.1.14

func (x *LoadedVM) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LoadedVM out of the buffer that arrived.

type LoadedVMs added in v1.1.14

type LoadedVMs []LoadedVM

LoadedVMs are the VMs a reload brought in: an object keyed by VM id on the JSON wire, a list ordered by that id here.

func (LoadedVMs) MarshalJSON added in v1.1.14

func (l LoadedVMs) MarshalJSON() ([]byte, error)

func (*LoadedVMs) UnmarshalJSON added in v1.1.14

func (l *LoadedVMs) UnmarshalJSON(b []byte) error

type LogAndDisplayLevels

type LogAndDisplayLevels struct {
	LogLevel     string `json:"logLevel"`
	DisplayLevel string `json:"displayLevel"`
}

LogAndDisplayLevels pairs log and display levels.

func (*LogAndDisplayLevels) MarshalZAP added in v1.1.14

func (x *LogAndDisplayLevels) MarshalZAP() ([]byte, error)

MarshalZAP writes LogAndDisplayLevels from constant offsets.

func (*LogAndDisplayLevels) UnmarshalZAP added in v1.1.14

func (x *LogAndDisplayLevels) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LogAndDisplayLevels out of the buffer that arrived.

type LoggerLevel added in v1.1.14

type LoggerLevel struct {
	// Logger is the logger's name, the key it appears under on the JSON wire.
	Logger string `json:"logger"`
	// Levels are what it writes to its file and to the display.
	Levels LogAndDisplayLevels `json:"levels"`
}

LoggerLevel is one logger and the two levels it is set to.

func (*LoggerLevel) MarshalZAP added in v1.1.14

func (x *LoggerLevel) MarshalZAP() ([]byte, error)

MarshalZAP writes LoggerLevel from constant offsets.

func (*LoggerLevel) UnmarshalZAP added in v1.1.14

func (x *LoggerLevel) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LoggerLevel out of the buffer that arrived.

type LoggerLevelReply

type LoggerLevelReply struct {
	LoggerLevels LoggerLevels `json:"loggerLevels"`
}

LoggerLevelReply are the levels of the loggers.

func (*LoggerLevelReply) MarshalZAP added in v1.1.14

func (x *LoggerLevelReply) MarshalZAP() ([]byte, error)

MarshalZAP writes LoggerLevelReply from constant offsets.

func (*LoggerLevelReply) UnmarshalZAP added in v1.1.14

func (x *LoggerLevelReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LoggerLevelReply out of the buffer that arrived.

type LoggerLevels added in v1.1.14

type LoggerLevels []LoggerLevel

LoggerLevels are the levels every named logger is set to: an object keyed by logger name on the JSON wire, a list ordered by that name here.

func (LoggerLevels) MarshalJSON added in v1.1.14

func (l LoggerLevels) MarshalJSON() ([]byte, error)

func (*LoggerLevels) UnmarshalJSON added in v1.1.14

func (l *LoggerLevels) UnmarshalJSON(b []byte) error

type Service

type Service interface {
	StartCPUProfiler(ctx context.Context) (*EmptyReply, error)
	StopCPUProfiler(ctx context.Context) (*EmptyReply, error)
	MemoryProfile(ctx context.Context) (*EmptyReply, error)
	LockProfile(ctx context.Context) (*EmptyReply, error)

	Alias(ctx context.Context, args *AliasArgs) (*EmptyReply, error)
	AliasChain(ctx context.Context, args *AliasChainArgs) (*EmptyReply, error)
	GetChainAliases(ctx context.Context, args *GetChainAliasesArgs) (*GetChainAliasesReply, error)

	Stacktrace(ctx context.Context) (*EmptyReply, error)
	SetLoggerLevel(ctx context.Context, args *SetLoggerLevelArgs) (*EmptyReply, error)
	GetLoggerLevel(ctx context.Context, args *GetLoggerLevelArgs) (*LoggerLevelReply, error)
	GetConfig(ctx context.Context) (any, error)

	LoadVMs(ctx context.Context) (*LoadVMsReply, error)
	DbGet(ctx context.Context, args *DBGetArgs) (*DBGetReply, error)
	ListVMs(ctx context.Context) (*ListVMsReply, error)

	SetTrackedChains(ctx context.Context, args *SetTrackedChainsArgs) (*SetTrackedChainsReply, error)
	GetTrackedChains(ctx context.Context) (*GetTrackedChainsReply, error)

	// Snapshot creates a database backup to the specified path.
	// Use .zst extension for zstd compression.
	// since: 0 for full backup, or version from last backup for incremental.
	// Returns the version number for future incremental backups.
	Snapshot(ctx context.Context, args *SnapshotArgs) (*SnapshotReply, error)

	// Load restores the database from a backup file.
	// Detects compression from .zst extension.
	Load(ctx context.Context, args *LoadArgs) (*EmptyReply, error)
}

Service defines the admin API contract.

type SetLoggerLevelArgs

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

SetLoggerLevelArgs are the arguments for setting a logger's levels.

func (*SetLoggerLevelArgs) MarshalZAP added in v1.1.13

func (x *SetLoggerLevelArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes SetLoggerLevelArgs from constant offsets.

func (*SetLoggerLevelArgs) UnmarshalZAP added in v1.1.13

func (x *SetLoggerLevelArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads SetLoggerLevelArgs out of the buffer that arrived.

type SetTrackedChainsArgs

type SetTrackedChainsArgs struct {
	Chains []string `json:"chains"`
}

SetTrackedChainsArgs are the arguments for SetTrackedChains.

func (*SetTrackedChainsArgs) MarshalZAP added in v1.1.13

func (x *SetTrackedChainsArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes SetTrackedChainsArgs from constant offsets.

func (*SetTrackedChainsArgs) UnmarshalZAP added in v1.1.13

func (x *SetTrackedChainsArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads SetTrackedChainsArgs out of the buffer that arrived.

type SetTrackedChainsReply

type SetTrackedChainsReply struct {
	TrackedChains []string `json:"trackedChains"`
}

SetTrackedChainsReply is the response for SetTrackedChains.

func (*SetTrackedChainsReply) MarshalZAP added in v1.1.13

func (x *SetTrackedChainsReply) MarshalZAP() ([]byte, error)

MarshalZAP writes SetTrackedChainsReply from constant offsets.

func (*SetTrackedChainsReply) UnmarshalZAP added in v1.1.13

func (x *SetTrackedChainsReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads SetTrackedChainsReply out of the buffer that arrived.

type SnapshotArgs

type SnapshotArgs struct {
	Path  string `json:"path"`
	Since uint64 `json:"since"`
}

SnapshotArgs are the arguments for Snapshot.

func (*SnapshotArgs) MarshalZAP added in v1.1.13

func (x *SnapshotArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes SnapshotArgs from constant offsets.

func (*SnapshotArgs) UnmarshalZAP added in v1.1.13

func (x *SnapshotArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads SnapshotArgs out of the buffer that arrived.

type SnapshotReply

type SnapshotReply struct {
	Version uint64 `json:"version"`
}

SnapshotReply is the response for Snapshot.

func (*SnapshotReply) MarshalZAP added in v1.1.13

func (x *SnapshotReply) MarshalZAP() ([]byte, error)

MarshalZAP writes SnapshotReply from constant offsets.

func (*SnapshotReply) UnmarshalZAP added in v1.1.13

func (x *SnapshotReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads SnapshotReply out of the buffer that arrived.

type VMInfo

type VMInfo struct {
	ID      string   `json:"id"`
	Aliases []string `json:"aliases"`
	Path    string   `json:"path,omitempty"`
}

VMInfo contains information about a registered VM.

func (*VMInfo) MarshalZAP added in v1.1.14

func (x *VMInfo) MarshalZAP() ([]byte, error)

MarshalZAP writes VMInfo from constant offsets.

func (*VMInfo) UnmarshalZAP added in v1.1.14

func (x *VMInfo) UnmarshalZAP(data []byte) error

UnmarshalZAP reads VMInfo out of the buffer that arrived.

Jump to

Keyboard shortcuts

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