types

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultHomeDirectory = func() string {
		home, err := os.UserHomeDir()
		if err != nil {
			panic(err)
		}

		return filepath.Join(home, ".sentinelcli")
	}()
)

Functions

This section is empty.

Types

type Bandwidth

type Bandwidth struct {
	Upload   int64 `json:"upload"`
	Download int64 `json:"download"`
}

func NewBandwidthFromRaw

func NewBandwidthFromRaw(v hubtypes.Bandwidth) Bandwidth

func (Bandwidth) String

func (b Bandwidth) String() string

type Coin

type Coin struct {
	Denom string `json:"denom"`
	Value int64  `json:"value"`
}

func NewCoinFromRaw

func NewCoinFromRaw(v *sdk.Coin) Coin

func (*Coin) Raw

func (c *Coin) Raw() sdk.Coin

type Coins

type Coins []Coin

func NewCoinsFromRaw

func NewCoinsFromRaw(v sdk.Coins) Coins

func (Coins) Raw

func (c Coins) Raw() sdk.Coins

type DecCoin

type DecCoin struct {
	Denom string `json:"denom"`
	Value string `json:"value"`
}

func NewDecCoinFromRaw

func NewDecCoinFromRaw(v *sdk.DecCoin) DecCoin

func (*DecCoin) Raw

func (c *DecCoin) Raw() sdk.DecCoin

type DecCoins

type DecCoins []DecCoin

func NewDecCoinsFromRaw

func NewDecCoinsFromRaw(v sdk.DecCoins) DecCoins

func (DecCoins) Raw

func (c DecCoins) Raw() sdk.DecCoins

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Module  string `json:"module,omitempty"`
}

func NewError

func NewError(module string, code int, message string) *Error

type Response

type Response struct {
	Success bool        `json:"success"`
	Error   *Error      `json:"error,omitempty"`
	Result  interface{} `json:"result,omitempty"`
}

type Service

type Service interface {
	Info() []byte
	PreUp() error
	IsUp() bool
	Up() error
	PostUp() error
	PreDown() error
	Down() error
	PostDown() error
	Transfer() (int64, int64, error)
}

type Status

type Status struct {
	From  string `json:"from"`
	ID    uint64 `json:"id"`
	IFace string `json:"iface"`
	To    string `json:"to"`
}

func NewStatus

func NewStatus() *Status

func (*Status) LoadFromPath

func (s *Status) LoadFromPath(path string) error

func (*Status) SaveToPath

func (s *Status) SaveToPath(path string) error

func (*Status) WithFrom

func (s *Status) WithFrom(v string) *Status

func (*Status) WithID

func (s *Status) WithID(v uint64) *Status

func (*Status) WithIFace

func (s *Status) WithIFace(v string) *Status

func (*Status) WithTo

func (s *Status) WithTo(v string) *Status

Jump to

Keyboard shortcuts

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