core

package
v0.0.0-...-3b153a2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWalletPassword = "OpenDEX!Rocks"
	ServiceStuckThreshold = 100
	StatusQueryInterval   = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Message string `json:"message"`
}

type BackupInfo

type BackupInfo struct {
	Location        string `json:"location"`
	DefaultLocation bool   `json:"defaultLocation"`
}

type ExportedConfig

type ExportedConfig struct {
	Timestamp string          `json:"timestamp"`
	Network   string          `json:"network"`
	Services  []ServiceConfig `json:"services"`
}

type Info

type Info struct {
	Wallets WalletsInfo `json:"wallets"`
	Backup  BackupInfo  `json:"backup"`
}

type Launcher

type Launcher struct {
	Logger         *logrus.Entry
	Services       map[string]types.Service
	ServicesOrder  []string
	ServicesConfig map[string]interface{}

	HomeDir string

	Network types.Network

	NetworkDir       string
	DataDir          string
	LogsDir          string
	BackupDir        string
	DefaultBackupDir string

	DockerComposeFile string
	ConfigFile        string

	PasswordUnsetMarker string
	ExternalIp          string

	LogFile *os.File
	// contains filtered or unexported fields
}

func NewLauncher

func NewLauncher() (*Launcher, error)

func (*Launcher) AddServiceFlags

func (t *Launcher) AddServiceFlags(cmd *cobra.Command) error

func (*Launcher) Apply

func (t *Launcher) Apply() error

apply configurations into services

func (*Launcher) Attach

func (t *Launcher) Attach() error

func (*Launcher) BackupTo

func (t *Launcher) BackupTo(ctx context.Context, location string) error

func (*Launcher) Cleanup

func (t *Launcher) Cleanup(ctx context.Context) error

func (*Launcher) Close

func (t *Launcher) Close()

func (*Launcher) Create

func (t *Launcher) Create(ctx context.Context) error

func (*Launcher) Down

func (t *Launcher) Down(ctx context.Context) error

func (*Launcher) Gen

func (t *Launcher) Gen(ctx context.Context) error

func (*Launcher) GenConfigJson

func (t *Launcher) GenConfigJson() error

func (*Launcher) GenDockerComposeYaml

func (t *Launcher) GenDockerComposeYaml() error

func (*Launcher) GetBackupDir

func (t *Launcher) GetBackupDir() string

func (*Launcher) GetDataDir

func (t *Launcher) GetDataDir() string

func (*Launcher) GetExternalIp

func (t *Launcher) GetExternalIp() string

func (*Launcher) GetInfo

func (t *Launcher) GetInfo() Info

func (*Launcher) GetNetwork

func (t *Launcher) GetNetwork() types.Network

func (*Launcher) GetNetworkDir

func (t *Launcher) GetNetworkDir() string

func (*Launcher) GetService

func (t *Launcher) GetService(name string) (types.Service, error)

func (*Launcher) Pull

func (t *Launcher) Pull(ctx context.Context) error

func (*Launcher) Restart

func (t *Launcher) Restart(ctx context.Context) error

func (*Launcher) Run

func (t *Launcher) Run() error

func (*Launcher) Setup

func (t *Launcher) Setup(ctx context.Context, pull bool) error

func (*Launcher) Start

func (t *Launcher) Start(ctx context.Context) error

func (*Launcher) Status

func (t *Launcher) Status(ctx context.Context, name string) (string, error)

func (*Launcher) Stop

func (t *Launcher) Stop(ctx context.Context) error

func (*Launcher) Update

func (t *Launcher) Update(ctx context.Context)

func (*Launcher) UsingDefaultPassword

func (t *Launcher) UsingDefaultPassword() bool

type Request

type Request struct {
	Id     uint64   `json:"id"`
	Method string   `json:"method"`
	Params []string `json:"params"`
}

type ServiceConfig

type ServiceConfig struct {
	Name     string      `json:"name"`
	Disabled bool        `json:"disabled"`
	Rpc      interface{} `json:"rpc"`
	Mode     string      `json:"mode,omitempty"`
}

type WalletsInfo

type WalletsInfo struct {
	DefaultPassword bool `json:"defaultPassword"`
	MnemonicShown   bool `json:"mnemonicShown"`
}

Jump to

Keyboard shortcuts

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