cli

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfigFile is the default config file name
	DefaultConfigFile = "config.toml"
	// DefaultDataDir is the default data directory name
	DefaultDataDir = "data"
	// DefaultTokenFile is the default token file name
	DefaultTokenFile = "token"
)

Variables

View Source
var Commands = []*cli.Command{
	runCommand,
	tokenSubCommand,
	userSubCommand,
	minerSubCommand,
	signerSubCommand,
}

Functions

func GetCli

func GetCli(ctx *cli.Context) (*jwtclient.AuthClient, error)

func GetRepoPath

func GetRepoPath(ctx *cli.Context) (string, error)

Types

type FsRepo

type FsRepo struct {
	// contains filtered or unexported fields
}

func (*FsRepo) GetConfig

func (r *FsRepo) GetConfig() (*config.Config, error)

func (*FsRepo) GetDataDir

func (r *FsRepo) GetDataDir() string

func (*FsRepo) GetToken

func (r *FsRepo) GetToken() (string, error)

func (*FsRepo) SaveConfig

func (r *FsRepo) SaveConfig(cnf *config.Config) error

func (*FsRepo) SaveToken

func (r *FsRepo) SaveToken(token string) error

type Repo

type Repo interface {
	GetConfig() (*config.Config, error)
	SaveConfig(*config.Config) error
	GetToken() (string, error)
	SaveToken(string) error
	GetDataDir() string
}

func NewFsRepo

func NewFsRepo(repoPath string) (Repo, error)

Jump to

Keyboard shortcuts

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