network

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNetworkDoesNotHaveGRPCHostConfigured              = errors.New("network configuration does not have any gRPC host set")
	ErrNetworkDoesNotHaveHostConfiguredForConsole        = errors.New("network configuration does not have any host set for console")
	ErrNetworkDoesNotHaveLocalPortConfiguredForConsole   = errors.New("network configuration does not have any local port set for console")
	ErrNetworkDoesNotHaveHostConfiguredForTokenDApp      = errors.New("network configuration does not have any host set for token dApp")
	ErrNetworkDoesNotHaveLocalPortConfiguredForTokenDApp = errors.New("network configuration does not have any local port set for token dApp")
)

Functions

func DeleteNetwork added in v0.11.0

func DeleteNetwork(store Store, req *DeleteNetworkRequest) error

func ImportNetwork

func ImportNetwork(store Store, net *Network, overwrite bool) error

Types

type APIConfig

type APIConfig struct {
	GRPC    GRPCConfig    `json:"grpc"`
	REST    RESTConfig    `json:"rest"`
	GraphQL GraphQLConfig `json:"graphQl"`
}

type ConsoleConfig

type ConsoleConfig struct {
	URL       string `json:"url"`
	LocalPort int    `json:"localPort"`
}

type DeleteNetworkRequest added in v0.11.0

type DeleteNetworkRequest struct {
	Name string `json:"name"`
}

type DescribeNetworkRequest added in v0.10.0

type DescribeNetworkRequest struct {
	Name string `json:"name"`
}

type DescribeNetworkResponse added in v0.10.0

type DescribeNetworkResponse struct {
	Name        string `json:"name"`
	Level       string `json:"logLevel"`
	TokenExpiry string `json:"tokenExpiry"`
	Port        int    `json:"port"`
	Host        string `json:"host"`
	API         struct {
		GRPCConfig struct {
			Hosts   []string `json:"hosts"`
			Retries uint64   `json:"retries"`
		} `json:"grpcConfig"`
		RESTConfig struct {
			Hosts []string `json:"hosts"`
		} `json:"restConfig"`
		GraphQLConfig struct {
			Hosts []string `json:"hosts"`
		} `json:"graphQLConfig"`
	} `json:"api"`
	Console struct {
		URL       string `json:"url"`
		LocalPort int    `json:"localPort"`
	}
}

func DescribeNetwork added in v0.10.0

func DescribeNetwork(store Store, req *DescribeNetworkRequest) (*DescribeNetworkResponse, error)

type GRPCConfig

type GRPCConfig struct {
	Hosts   []string `json:"hosts"`
	Retries uint64   `json:"retries"`
}

type GraphQLConfig

type GraphQLConfig struct {
	Hosts []string `json:"hosts"`
}

type ImportNetworkFromSourceRequest added in v0.10.0

type ImportNetworkFromSourceRequest struct {
	FilePath string `json:"filePath"`
	URL      string `json:"url"`
	Name     string `json:"name"`
	Force    bool   `json:"force"`
}

type ImportNetworkFromSourceResponse added in v0.10.0

type ImportNetworkFromSourceResponse struct {
	Name     string `json:"name"`
	FilePath string `json:"filePath"`
}

func ImportNetworkFromSource added in v0.10.0

func ImportNetworkFromSource(s Store, rs Readers, req *ImportNetworkFromSourceRequest) (*ImportNetworkFromSourceResponse, error)

type ListNetworksResponse added in v0.10.0

type ListNetworksResponse struct {
	Networks []string `json:"networks"`
}

func ListNetworks added in v0.10.0

func ListNetworks(store Store) (*ListNetworksResponse, error)

type Network

type Network struct {
	Name        string            `json:"name"`
	Level       encoding.LogLevel `json:"level"`
	TokenExpiry encoding.Duration `json:"tokenExpiry"`
	Port        int               `json:"port"`
	Host        string            `json:"host"`
	API         APIConfig         `json:"api"`
	TokenDApp   TokenDAppConfig   `json:"tokenDApp"`
	Console     ConsoleConfig     `json:"console"`
}

func GetNetwork added in v0.10.0

func GetNetwork(store Store, name string) (*Network, error)

func (*Network) EnsureCanConnectConsole added in v0.11.1

func (n *Network) EnsureCanConnectConsole() error

func (*Network) EnsureCanConnectGRPCNode added in v0.11.1

func (n *Network) EnsureCanConnectGRPCNode() error

func (*Network) EnsureCanConnectTokenDApp added in v0.11.1

func (n *Network) EnsureCanConnectTokenDApp() error

type NetworkAlreadyExistsError added in v0.9.2

type NetworkAlreadyExistsError struct {
	Name string
}

func NewNetworkAlreadyExistsError added in v0.9.2

func NewNetworkAlreadyExistsError(n string) NetworkAlreadyExistsError

func (NetworkAlreadyExistsError) Error added in v0.9.2

type NetworkDoesNotExistError added in v0.9.2

type NetworkDoesNotExistError struct {
	Name string
}

func NewNetworkDoesNotExistError added in v0.9.2

func NewNetworkDoesNotExistError(n string) NetworkDoesNotExistError

func (NetworkDoesNotExistError) Error added in v0.9.2

func (e NetworkDoesNotExistError) Error() string

type RESTConfig

type RESTConfig struct {
	Hosts []string `json:"hosts"`
}

type Reader added in v0.10.0

type Reader func(uri string, net interface{}) error

type Readers added in v0.10.0

type Readers struct {
	ReadFromFile Reader
	ReadFromURL  Reader
}

func NewReaders added in v0.10.0

func NewReaders() Readers

type Store

type Store interface {
	NetworkExists(string) (bool, error)
	GetNetwork(string) (*Network, error)
	SaveNetwork(*Network) error
	ListNetworks() ([]string, error)
	GetNetworkPath(string) string
	DeleteNetwork(string) error
}

type TokenDAppConfig added in v0.11.0

type TokenDAppConfig struct {
	URL       string `json:"url"`
	LocalPort int    `json:"localPort"`
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
store
v1

Jump to

Keyboard shortcuts

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