types

package
v0.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FlagTimeout        = "timeout"
	FlagResolver       = "resolver"
	FlagV2RayProxyPort = "v2ray.proxy-port"
)

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 EncodingConfig added in v0.3.2

type EncodingConfig struct {
	Amino             *codec.LegacyAmino
	Codec             codec.Codec
	InterfaceRegistry codectypes.InterfaceRegistry
	TxConfig          client.TxConfig
}

func DefaultEncodingConfig added in v0.3.2

func DefaultEncodingConfig() EncodingConfig

func NewEncodingConfig added in v0.3.2

func NewEncodingConfig() EncodingConfig

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"`
	To   string `json:"to"`
	Type uint64 `json:"type"`
	Info []byte `json:"info"`
}

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) WithInfo added in v0.3.0

func (s *Status) WithInfo(v []byte) *Status

func (*Status) WithTo

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

func (*Status) WithType added in v0.3.0

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

Jump to

Keyboard shortcuts

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