node

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitK8sClient

func InitK8sClient() (client.Client, error)

func Register

func Register(deployMethod DeployMethod, register Creator)

Types

type Action

type Action string
const (
	StopAndStart Action = "StopAndStart"
	Direct       Action = "Direct"
)

type Creator

type Creator func(namespace, name string, client client.Client, chain string, execer exec.Interface) (Node, error)

type DeployMethod

type DeployMethod string
const (
	PythonOperator DeployMethod = "python"
	Helm           DeployMethod = "helm"
	CloudConfig    DeployMethod = "cloud-config"
)

type Node

type Node interface {
	Stop(ctx context.Context) error
	CheckStopped(ctx context.Context) error
	Fallback(ctx context.Context, action Action, blockHeight int64, crypto, consensus string, deleteConsensusData bool) error
	Start(ctx context.Context) error
	Backup(ctx context.Context, action Action, sourcePath string, destPath string, options *common.CompressOptions) error
	Restore(ctx context.Context, action Action, sourcePath string, destPath string, options *common.DecompressOptions, deleteConsensusData bool) error
	GetName() string
	GetAccountConfigmap(ctx context.Context) (string, error)
	UpdateAccountConfigmap(ctx context.Context, newConfigmap string) error
	Snapshot(ctx context.Context, action Action, blockHeight int64, crypto, consensus string) error
	SnapshotRecover(ctx context.Context, action Action, blockHeight int64, crypto, consensus string, deleteConsensusData bool) error
	ChangeOwner(ctx context.Context, action Action, uid, gid int64) error
}

func CreateNode

func CreateNode(deployMethod DeployMethod, namespace, name string, client client.Client, chain string, execer exec.Interface) (Node, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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