proxy

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	jsonrpc2.Client
	// contains filtered or unexported fields
}

func New

func New(server string) (*Client, error)

New creates new API client with default config

func (*Client) GetNetworkConfig

func (c *Client) GetNetworkConfig(ctx context.Context, req *NetworkConfigRequest) (*NetworkConfigResponse, error)

GetNetworkConfig get full network description

func (*Client) GetPartitionList

func (c *Client) GetPartitionList(ctx context.Context, req *PartitionListRequest) (*PartitionListResponse, error)

GetPartitionList get list of Partitions on a given network

func (*Client) GetSeedCount

func (c *Client) GetSeedCount(ctx context.Context, req *SeedCountRequest) (*SeedCountResponse, error)

GetIp get list of seed ip's.

func (*Client) GetSeedList

func (c *Client) GetSeedList(ctx context.Context, req *SeedListRequest) (*SeedListResponse, error)

GetSeedList get list of seed ip's for a particular Partition

func (*Client) RequestAPIv2

func (c *Client) RequestAPIv2(ctx context.Context, method string, params, result interface{}) error

RequestAPIv2 makes a JSON RPC request

type NetworkConfigRequest

type NetworkConfigRequest struct {
	Network string `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Sign    bool   `json:"sign,omitempty" form:"sign" query:"sign"`
}

func (*NetworkConfigRequest) Copy

func (*NetworkConfigRequest) CopyAsInterface

func (v *NetworkConfigRequest) CopyAsInterface() interface{}

func (*NetworkConfigRequest) Equal

type NetworkConfigResponse

type NetworkConfigResponse struct {
	NetworkState NetworkState          `json:"networkState,omitempty" form:"networkState" query:"networkState" validate:"required"`
	Signature    protocol.KeySignature `json:"signature,omitempty" form:"signature" query:"signature"`
}

func (*NetworkConfigResponse) Copy

func (*NetworkConfigResponse) CopyAsInterface

func (v *NetworkConfigResponse) CopyAsInterface() interface{}

func (*NetworkConfigResponse) Equal

func (*NetworkConfigResponse) MarshalJSON

func (v *NetworkConfigResponse) MarshalJSON() ([]byte, error)

func (*NetworkConfigResponse) UnmarshalJSON

func (v *NetworkConfigResponse) UnmarshalJSON(data []byte) error

type NetworkState

type NetworkState struct {
	Network        config.Network `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Version        string         `json:"version,omitempty" form:"version" query:"version" validate:"required"`
	Commit         string         `json:"commit,omitempty" form:"commit" query:"commit" validate:"required"`
	VersionIsKnown bool           `json:"versionIsKnown,omitempty" form:"versionIsKnown" query:"versionIsKnown" validate:"required"`
	IsTestNet      bool           `json:"isTestNet,omitempty" form:"isTestNet" query:"isTestNet" validate:"required"`
	// contains filtered or unexported fields
}

func (*NetworkState) Copy

func (v *NetworkState) Copy() *NetworkState

func (*NetworkState) CopyAsInterface

func (v *NetworkState) CopyAsInterface() interface{}

func (*NetworkState) Equal

func (v *NetworkState) Equal(u *NetworkState) bool

func (*NetworkState) IsValid

func (v *NetworkState) IsValid() error

func (*NetworkState) MarshalBinary

func (v *NetworkState) MarshalBinary() ([]byte, error)

func (*NetworkState) UnmarshalBinary

func (v *NetworkState) UnmarshalBinary(data []byte) error

func (*NetworkState) UnmarshalBinaryFrom

func (v *NetworkState) UnmarshalBinaryFrom(rd io.Reader) error

type PartitionList

type PartitionList struct {
	Partitions []string `json:"partitions,omitempty" form:"partitions" query:"partitions" validate:"required"`
	// contains filtered or unexported fields
}

func (*PartitionList) Copy

func (v *PartitionList) Copy() *PartitionList

func (*PartitionList) CopyAsInterface

func (v *PartitionList) CopyAsInterface() interface{}

func (*PartitionList) Equal

func (v *PartitionList) Equal(u *PartitionList) bool

func (*PartitionList) IsValid

func (v *PartitionList) IsValid() error

func (*PartitionList) MarshalBinary

func (v *PartitionList) MarshalBinary() ([]byte, error)

func (*PartitionList) MarshalJSON

func (v *PartitionList) MarshalJSON() ([]byte, error)

func (*PartitionList) UnmarshalBinary

func (v *PartitionList) UnmarshalBinary(data []byte) error

func (*PartitionList) UnmarshalBinaryFrom

func (v *PartitionList) UnmarshalBinaryFrom(rd io.Reader) error

func (*PartitionList) UnmarshalJSON

func (v *PartitionList) UnmarshalJSON(data []byte) error

type PartitionListRequest

type PartitionListRequest struct {
	Network string `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Sign    bool   `json:"sign,omitempty" form:"sign" query:"sign"`
}

func (*PartitionListRequest) Copy

func (*PartitionListRequest) CopyAsInterface

func (v *PartitionListRequest) CopyAsInterface() interface{}

func (*PartitionListRequest) Equal

type PartitionListResponse

type PartitionListResponse struct {
	PartitionList
	Signature protocol.KeySignature `json:"signature,omitempty" form:"signature" query:"signature"`
}

func (*PartitionListResponse) Copy

func (*PartitionListResponse) CopyAsInterface

func (v *PartitionListResponse) CopyAsInterface() interface{}

func (*PartitionListResponse) Equal

func (*PartitionListResponse) MarshalJSON

func (v *PartitionListResponse) MarshalJSON() ([]byte, error)

func (*PartitionListResponse) UnmarshalJSON

func (v *PartitionListResponse) UnmarshalJSON(data []byte) error

type SeedCount

type SeedCount struct {
	Count int64 `json:"count,omitempty" form:"count" query:"count" validate:"required"`
	// contains filtered or unexported fields
}

func (*SeedCount) Copy

func (v *SeedCount) Copy() *SeedCount

func (*SeedCount) CopyAsInterface

func (v *SeedCount) CopyAsInterface() interface{}

func (*SeedCount) Equal

func (v *SeedCount) Equal(u *SeedCount) bool

func (*SeedCount) IsValid

func (v *SeedCount) IsValid() error

func (*SeedCount) MarshalBinary

func (v *SeedCount) MarshalBinary() ([]byte, error)

func (*SeedCount) UnmarshalBinary

func (v *SeedCount) UnmarshalBinary(data []byte) error

func (*SeedCount) UnmarshalBinaryFrom

func (v *SeedCount) UnmarshalBinaryFrom(rd io.Reader) error

type SeedCountRequest

type SeedCountRequest struct {
	Network   string `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Partition string `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	Sign      bool   `json:"sign,omitempty" form:"sign" query:"sign"`
}

func (*SeedCountRequest) Copy

func (*SeedCountRequest) CopyAsInterface

func (v *SeedCountRequest) CopyAsInterface() interface{}

func (*SeedCountRequest) Equal

func (v *SeedCountRequest) Equal(u *SeedCountRequest) bool

type SeedCountResponse

type SeedCountResponse struct {
	SeedCount
	Signature protocol.KeySignature `json:"signature,omitempty" form:"signature" query:"signature"`
}

func (*SeedCountResponse) Copy

func (*SeedCountResponse) CopyAsInterface

func (v *SeedCountResponse) CopyAsInterface() interface{}

func (*SeedCountResponse) Equal

func (*SeedCountResponse) MarshalJSON

func (v *SeedCountResponse) MarshalJSON() ([]byte, error)

func (*SeedCountResponse) UnmarshalJSON

func (v *SeedCountResponse) UnmarshalJSON(data []byte) error

type SeedList

type SeedList struct {
	BasePort  uint64                 `json:"basePort,omitempty" form:"basePort" query:"basePort" validate:"required"`
	Type      protocol.PartitionType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Addresses []string               `json:"addresses,omitempty" form:"addresses" query:"addresses" validate:"required"`
	// contains filtered or unexported fields
}

func (*SeedList) Copy

func (v *SeedList) Copy() *SeedList

func (*SeedList) CopyAsInterface

func (v *SeedList) CopyAsInterface() interface{}

func (*SeedList) Equal

func (v *SeedList) Equal(u *SeedList) bool

func (*SeedList) IsValid

func (v *SeedList) IsValid() error

func (*SeedList) MarshalBinary

func (v *SeedList) MarshalBinary() ([]byte, error)

func (*SeedList) MarshalJSON

func (v *SeedList) MarshalJSON() ([]byte, error)

func (*SeedList) UnmarshalBinary

func (v *SeedList) UnmarshalBinary(data []byte) error

func (*SeedList) UnmarshalBinaryFrom

func (v *SeedList) UnmarshalBinaryFrom(rd io.Reader) error

func (*SeedList) UnmarshalJSON

func (v *SeedList) UnmarshalJSON(data []byte) error

type SeedListRequest

type SeedListRequest struct {
	Network   string `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	Partition string `json:"partition,omitempty" form:"partition" query:"partition" validate:"required"`
	Count     int64  `json:"count,omitempty" form:"count" query:"count" validate:"required"`
	Sign      bool   `json:"sign,omitempty" form:"sign" query:"sign"`
}

func (*SeedListRequest) Copy

func (v *SeedListRequest) Copy() *SeedListRequest

func (*SeedListRequest) CopyAsInterface

func (v *SeedListRequest) CopyAsInterface() interface{}

func (*SeedListRequest) Equal

func (v *SeedListRequest) Equal(u *SeedListRequest) bool

type SeedListResponse

type SeedListResponse struct {
	SeedList
	Signature protocol.KeySignature `json:"signature,omitempty" form:"signature" query:"signature"`
}

func (*SeedListResponse) Copy

func (*SeedListResponse) CopyAsInterface

func (v *SeedListResponse) CopyAsInterface() interface{}

func (*SeedListResponse) Equal

func (v *SeedListResponse) Equal(u *SeedListResponse) bool

func (*SeedListResponse) MarshalJSON

func (v *SeedListResponse) MarshalJSON() ([]byte, error)

func (*SeedListResponse) UnmarshalJSON

func (v *SeedListResponse) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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