types

package
v0.0.0-...-1ac23cf Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FlagHome = "home"
)

Variables

View Source
var (
	Version              = ""
	DefaultListenURL     = "http://127.0.0.1:26667"
	DefaultHomeDirectory = func() string {
		home, err := os.UserHomeDir()
		if err != nil {
			panic(err)
		}

		return filepath.Join(home, ".sentinel", "client")
	}()
	Denom = "udvpn"
)
View Source
var (
	LineBreakCmd = &cobra.Command{Run: func(_ *cobra.Command, _ []string) {}}
)

Functions

This section is empty.

Types

type AuthToken

type AuthToken struct {
	Access  Token `json:"access"`
	Refresh Token `json:"refresh"`
}

type Config

type Config struct {
	Setup   bool   `json:"setup"`
	Version uint64 `json:"version"`
	Chain   struct {
		BroadcastMode      string  `json:"broadcast_mode"`
		GasAdjustment      float64 `json:"gas_adjustment"`
		GasPrices          string  `json:"gas_prices"`
		Gas                uint64  `json:"gas"`
		ID                 string  `json:"id"`
		RPCAddress         string  `json:"rpc_address"`
		SimulateAndExecute bool    `json:"simulate_and_execute"`
	} `json:"chain"`
	CORS struct {
		AllowedOrigins string `json:"allowed_origins"`
	} `json:"cors"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Copy

func (c *Config) Copy() *Config

func (*Config) LoadFromPath

func (c *Config) LoadFromPath(path string) error

func (*Config) SaveToPath

func (c *Config) SaveToPath(path string) error

func (*Config) String

func (c *Config) String() string

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) WithDefaultValues

func (c *Config) WithDefaultValues() *Config

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 ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	Status int
	Length int
}

func NewResponseWriter

func NewResponseWriter(w http.ResponseWriter) *ResponseWriter

func (*ResponseWriter) Header

func (r *ResponseWriter) Header() http.Header

func (*ResponseWriter) Write

func (r *ResponseWriter) Write(p []byte) (n int, err error)

func (*ResponseWriter) WriteHeader

func (r *ResponseWriter) WriteHeader(status int)

type Service

type Service interface {
	Info() []byte
	PreUp() error
	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"`
	Name string `json:"name"`
	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) WithName

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

func (*Status) WithTo

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

type Token

type Token struct {
	Value  string    `json:"value"`
	Expiry time.Time `json:"expiry"`
}

Jump to

Keyboard shortcuts

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