gateway

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 12 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 {
	// contains filtered or unexported fields
}

Client for gateway API

func (*Client) GetGateway

func (a *Client) GetGateway(params *GetGatewayParams, authInfo runtime.ClientAuthInfoWriter) (*GetGatewayOK, error)

GetGateway returns information about the gateway, including the list of connected peers.

func (*Client) PostGatewayConnectNetaddress

PostGatewayConnectNetaddress connects the gateway to a peer. The peer is added to the node list if it is not already present. The node list is the list of all nodes the gateway knows about, but is not necessarily connected to.

func (*Client) PostGatewayDisconnectNetaddress

PostGatewayDisconnectNetaddress disconnects the gateway from a peer. The peer remains in the node list. Disconnecting from a peer does not prevent the gateway from automatically connecting to the peer in the future.

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

type ClientService added in v0.5.9

type ClientService interface {
	GetGateway(params *GetGatewayParams, authInfo runtime.ClientAuthInfoWriter) (*GetGatewayOK, error)

	PostGatewayConnectNetaddress(params *PostGatewayConnectNetaddressParams, authInfo runtime.ClientAuthInfoWriter) (*PostGatewayConnectNetaddressNoContent, error)

	PostGatewayDisconnectNetaddress(params *PostGatewayDisconnectNetaddressParams, authInfo runtime.ClientAuthInfoWriter) (*PostGatewayDisconnectNetaddressNoContent, error)

	SetTransport(transport runtime.ClientTransport)
}

ClientService is the interface for Client methods

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService

New creates a new gateway API client.

type GetGatewayDefault

type GetGatewayDefault struct {
	Payload *models.StandardError
	// contains filtered or unexported fields
}
GetGatewayDefault describes a response with status code -1, with default header values.

Error Response

func NewGetGatewayDefault

func NewGetGatewayDefault(code int) *GetGatewayDefault

NewGetGatewayDefault creates a GetGatewayDefault with default headers values

func (*GetGatewayDefault) Code

func (o *GetGatewayDefault) Code() int

Code gets the status code for the get gateway default response

func (*GetGatewayDefault) Error

func (o *GetGatewayDefault) Error() string

func (*GetGatewayDefault) GetPayload added in v0.5.4

func (o *GetGatewayDefault) GetPayload() *models.StandardError

type GetGatewayOK

type GetGatewayOK struct {
	Payload *GetGatewayOKBody
}
GetGatewayOK describes a response with status code 200, with default header values.

Successful Response

func NewGetGatewayOK

func NewGetGatewayOK() *GetGatewayOK

NewGetGatewayOK creates a GetGatewayOK with default headers values

func (*GetGatewayOK) Error

func (o *GetGatewayOK) Error() string

func (*GetGatewayOK) GetPayload added in v0.5.4

func (o *GetGatewayOK) GetPayload() *GetGatewayOKBody

type GetGatewayOKBody

type GetGatewayOKBody struct {

	// netaddress is the network address of the gateway as seen by the rest of
	// the network. The address consists of the external IP address and the
	// port Sia is listening on. It represents a `modules.NetAddress`.
	//
	Netaddress string `json:"netaddress,omitempty"`

	// peers is an array of peers the gateway is connected to. It represents an array of `modules.Peer`s.
	Peers []*GetGatewayOKBodyPeersItems0 `json:"peers"`
}

GetGatewayOKBody get gateway o k body swagger:model GetGatewayOKBody

func (*GetGatewayOKBody) ContextValidate added in v0.5.9

func (o *GetGatewayOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validate this get gateway o k body based on the context it is used

func (*GetGatewayOKBody) MarshalBinary

func (o *GetGatewayOKBody) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*GetGatewayOKBody) UnmarshalBinary

func (o *GetGatewayOKBody) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*GetGatewayOKBody) Validate

func (o *GetGatewayOKBody) Validate(formats strfmt.Registry) error

Validate validates this get gateway o k body

type GetGatewayOKBodyPeersItems0 added in v0.5.9

type GetGatewayOKBodyPeersItems0 struct {

	// inbound is true when the peer initiated the connection. This field
	// is exposed as outbound peers are generally trusted more than inbound
	// peers, as inbound peers are easily manipulated by an adversary.
	//
	Inbound bool `json:"inbound,omitempty"`

	// netaddress is the address of the peer. It represents a `modules.NetAddress`.
	Netaddress string `json:"netaddress,omitempty"`

	// version is the version number of the peer.
	Version string `json:"version,omitempty"`
}

GetGatewayOKBodyPeersItems0 get gateway o k body peers items0 swagger:model GetGatewayOKBodyPeersItems0

func (*GetGatewayOKBodyPeersItems0) ContextValidate added in v0.5.9

func (o *GetGatewayOKBodyPeersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error

ContextValidate validates this get gateway o k body peers items0 based on context it is used

func (*GetGatewayOKBodyPeersItems0) MarshalBinary added in v0.5.9

func (o *GetGatewayOKBodyPeersItems0) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*GetGatewayOKBodyPeersItems0) UnmarshalBinary added in v0.5.9

func (o *GetGatewayOKBodyPeersItems0) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*GetGatewayOKBodyPeersItems0) Validate added in v0.5.9

func (o *GetGatewayOKBodyPeersItems0) Validate(formats strfmt.Registry) error

Validate validates this get gateway o k body peers items0

type GetGatewayParams

type GetGatewayParams struct {
	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

GetGatewayParams contains all the parameters to send to the API endpoint

for the get gateway operation.

Typically these are written to a http.Request.

func NewGetGatewayParams

func NewGetGatewayParams() *GetGatewayParams

NewGetGatewayParams creates a new GetGatewayParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewGetGatewayParamsWithContext

func NewGetGatewayParamsWithContext(ctx context.Context) *GetGatewayParams

NewGetGatewayParamsWithContext creates a new GetGatewayParams object with the ability to set a context for a request.

func NewGetGatewayParamsWithHTTPClient

func NewGetGatewayParamsWithHTTPClient(client *http.Client) *GetGatewayParams

NewGetGatewayParamsWithHTTPClient creates a new GetGatewayParams object with the ability to set a custom HTTPClient for a request.

func NewGetGatewayParamsWithTimeout

func NewGetGatewayParamsWithTimeout(timeout time.Duration) *GetGatewayParams

NewGetGatewayParamsWithTimeout creates a new GetGatewayParams object with the ability to set a timeout on a request.

func (*GetGatewayParams) SetContext

func (o *GetGatewayParams) SetContext(ctx context.Context)

SetContext adds the context to the get gateway params

func (*GetGatewayParams) SetDefaults added in v0.5.9

func (o *GetGatewayParams) SetDefaults()

SetDefaults hydrates default values in the get gateway params (not the query body).

All values with no default are reset to their zero value.

func (*GetGatewayParams) SetHTTPClient

func (o *GetGatewayParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the get gateway params

func (*GetGatewayParams) SetTimeout

func (o *GetGatewayParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the get gateway params

func (*GetGatewayParams) WithContext

func (o *GetGatewayParams) WithContext(ctx context.Context) *GetGatewayParams

WithContext adds the context to the get gateway params

func (*GetGatewayParams) WithDefaults added in v0.5.9

func (o *GetGatewayParams) WithDefaults() *GetGatewayParams

WithDefaults hydrates default values in the get gateway params (not the query body).

All values with no default are reset to their zero value.

func (*GetGatewayParams) WithHTTPClient

func (o *GetGatewayParams) WithHTTPClient(client *http.Client) *GetGatewayParams

WithHTTPClient adds the HTTPClient to the get gateway params

func (*GetGatewayParams) WithTimeout

func (o *GetGatewayParams) WithTimeout(timeout time.Duration) *GetGatewayParams

WithTimeout adds the timeout to the get gateway params

func (*GetGatewayParams) WriteToRequest

func (o *GetGatewayParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type GetGatewayReader

type GetGatewayReader struct {
	// contains filtered or unexported fields
}

GetGatewayReader is a Reader for the GetGateway structure.

func (*GetGatewayReader) ReadResponse

func (o *GetGatewayReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type PostGatewayConnectNetaddressDefault

type PostGatewayConnectNetaddressDefault struct {
	Payload *models.StandardError
	// contains filtered or unexported fields
}
PostGatewayConnectNetaddressDefault describes a response with status code -1, with default header values.

Error Response

func NewPostGatewayConnectNetaddressDefault

func NewPostGatewayConnectNetaddressDefault(code int) *PostGatewayConnectNetaddressDefault

NewPostGatewayConnectNetaddressDefault creates a PostGatewayConnectNetaddressDefault with default headers values

func (*PostGatewayConnectNetaddressDefault) Code

Code gets the status code for the post gateway connect netaddress default response

func (*PostGatewayConnectNetaddressDefault) Error

func (*PostGatewayConnectNetaddressDefault) GetPayload added in v0.5.4

type PostGatewayConnectNetaddressNoContent

type PostGatewayConnectNetaddressNoContent struct {
}
PostGatewayConnectNetaddressNoContent describes a response with status code 204, with default header values.

Successful Response

func NewPostGatewayConnectNetaddressNoContent

func NewPostGatewayConnectNetaddressNoContent() *PostGatewayConnectNetaddressNoContent

NewPostGatewayConnectNetaddressNoContent creates a PostGatewayConnectNetaddressNoContent with default headers values

func (*PostGatewayConnectNetaddressNoContent) Error

type PostGatewayConnectNetaddressParams

type PostGatewayConnectNetaddressParams struct {

	/* Netaddress.

	     address of the peer to connect to. It should be a
	reachable ip address and port number, of the form IP:port. IPV6 addresses
	must be enclosed in square brackets.

	*/
	Netaddress string

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

PostGatewayConnectNetaddressParams contains all the parameters to send to the API endpoint

for the post gateway connect netaddress operation.

Typically these are written to a http.Request.

func NewPostGatewayConnectNetaddressParams

func NewPostGatewayConnectNetaddressParams() *PostGatewayConnectNetaddressParams

NewPostGatewayConnectNetaddressParams creates a new PostGatewayConnectNetaddressParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewPostGatewayConnectNetaddressParamsWithContext

func NewPostGatewayConnectNetaddressParamsWithContext(ctx context.Context) *PostGatewayConnectNetaddressParams

NewPostGatewayConnectNetaddressParamsWithContext creates a new PostGatewayConnectNetaddressParams object with the ability to set a context for a request.

func NewPostGatewayConnectNetaddressParamsWithHTTPClient

func NewPostGatewayConnectNetaddressParamsWithHTTPClient(client *http.Client) *PostGatewayConnectNetaddressParams

NewPostGatewayConnectNetaddressParamsWithHTTPClient creates a new PostGatewayConnectNetaddressParams object with the ability to set a custom HTTPClient for a request.

func NewPostGatewayConnectNetaddressParamsWithTimeout

func NewPostGatewayConnectNetaddressParamsWithTimeout(timeout time.Duration) *PostGatewayConnectNetaddressParams

NewPostGatewayConnectNetaddressParamsWithTimeout creates a new PostGatewayConnectNetaddressParams object with the ability to set a timeout on a request.

func (*PostGatewayConnectNetaddressParams) SetContext

SetContext adds the context to the post gateway connect netaddress params

func (*PostGatewayConnectNetaddressParams) SetDefaults added in v0.5.9

func (o *PostGatewayConnectNetaddressParams) SetDefaults()

SetDefaults hydrates default values in the post gateway connect netaddress params (not the query body).

All values with no default are reset to their zero value.

func (*PostGatewayConnectNetaddressParams) SetHTTPClient

func (o *PostGatewayConnectNetaddressParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the post gateway connect netaddress params

func (*PostGatewayConnectNetaddressParams) SetNetaddress

func (o *PostGatewayConnectNetaddressParams) SetNetaddress(netaddress string)

SetNetaddress adds the netaddress to the post gateway connect netaddress params

func (*PostGatewayConnectNetaddressParams) SetTimeout

func (o *PostGatewayConnectNetaddressParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the post gateway connect netaddress params

func (*PostGatewayConnectNetaddressParams) WithContext

WithContext adds the context to the post gateway connect netaddress params

func (*PostGatewayConnectNetaddressParams) WithDefaults added in v0.5.9

WithDefaults hydrates default values in the post gateway connect netaddress params (not the query body).

All values with no default are reset to their zero value.

func (*PostGatewayConnectNetaddressParams) WithHTTPClient

WithHTTPClient adds the HTTPClient to the post gateway connect netaddress params

func (*PostGatewayConnectNetaddressParams) WithNetaddress

WithNetaddress adds the netaddress to the post gateway connect netaddress params

func (*PostGatewayConnectNetaddressParams) WithTimeout

WithTimeout adds the timeout to the post gateway connect netaddress params

func (*PostGatewayConnectNetaddressParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type PostGatewayConnectNetaddressReader

type PostGatewayConnectNetaddressReader struct {
	// contains filtered or unexported fields
}

PostGatewayConnectNetaddressReader is a Reader for the PostGatewayConnectNetaddress structure.

func (*PostGatewayConnectNetaddressReader) ReadResponse

func (o *PostGatewayConnectNetaddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

type PostGatewayDisconnectNetaddressDefault

type PostGatewayDisconnectNetaddressDefault struct {
	Payload *models.StandardError
	// contains filtered or unexported fields
}
PostGatewayDisconnectNetaddressDefault describes a response with status code -1, with default header values.

Error Response

func NewPostGatewayDisconnectNetaddressDefault

func NewPostGatewayDisconnectNetaddressDefault(code int) *PostGatewayDisconnectNetaddressDefault

NewPostGatewayDisconnectNetaddressDefault creates a PostGatewayDisconnectNetaddressDefault with default headers values

func (*PostGatewayDisconnectNetaddressDefault) Code

Code gets the status code for the post gateway disconnect netaddress default response

func (*PostGatewayDisconnectNetaddressDefault) Error

func (*PostGatewayDisconnectNetaddressDefault) GetPayload added in v0.5.4

type PostGatewayDisconnectNetaddressNoContent

type PostGatewayDisconnectNetaddressNoContent struct {
}
PostGatewayDisconnectNetaddressNoContent describes a response with status code 204, with default header values.

Successful Response

func NewPostGatewayDisconnectNetaddressNoContent

func NewPostGatewayDisconnectNetaddressNoContent() *PostGatewayDisconnectNetaddressNoContent

NewPostGatewayDisconnectNetaddressNoContent creates a PostGatewayDisconnectNetaddressNoContent with default headers values

func (*PostGatewayDisconnectNetaddressNoContent) Error

type PostGatewayDisconnectNetaddressParams

type PostGatewayDisconnectNetaddressParams struct {

	/* Netaddress.

	   address of the peer to connect to. It should be a reachable ip address and port number, of the form IP:port. IPV6 addresses must be enclosed in square brackets.

	*/
	Netaddress string

	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

PostGatewayDisconnectNetaddressParams contains all the parameters to send to the API endpoint

for the post gateway disconnect netaddress operation.

Typically these are written to a http.Request.

func NewPostGatewayDisconnectNetaddressParams

func NewPostGatewayDisconnectNetaddressParams() *PostGatewayDisconnectNetaddressParams

NewPostGatewayDisconnectNetaddressParams creates a new PostGatewayDisconnectNetaddressParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewPostGatewayDisconnectNetaddressParamsWithContext

func NewPostGatewayDisconnectNetaddressParamsWithContext(ctx context.Context) *PostGatewayDisconnectNetaddressParams

NewPostGatewayDisconnectNetaddressParamsWithContext creates a new PostGatewayDisconnectNetaddressParams object with the ability to set a context for a request.

func NewPostGatewayDisconnectNetaddressParamsWithHTTPClient

func NewPostGatewayDisconnectNetaddressParamsWithHTTPClient(client *http.Client) *PostGatewayDisconnectNetaddressParams

NewPostGatewayDisconnectNetaddressParamsWithHTTPClient creates a new PostGatewayDisconnectNetaddressParams object with the ability to set a custom HTTPClient for a request.

func NewPostGatewayDisconnectNetaddressParamsWithTimeout

func NewPostGatewayDisconnectNetaddressParamsWithTimeout(timeout time.Duration) *PostGatewayDisconnectNetaddressParams

NewPostGatewayDisconnectNetaddressParamsWithTimeout creates a new PostGatewayDisconnectNetaddressParams object with the ability to set a timeout on a request.

func (*PostGatewayDisconnectNetaddressParams) SetContext

SetContext adds the context to the post gateway disconnect netaddress params

func (*PostGatewayDisconnectNetaddressParams) SetDefaults added in v0.5.9

func (o *PostGatewayDisconnectNetaddressParams) SetDefaults()

SetDefaults hydrates default values in the post gateway disconnect netaddress params (not the query body).

All values with no default are reset to their zero value.

func (*PostGatewayDisconnectNetaddressParams) SetHTTPClient

func (o *PostGatewayDisconnectNetaddressParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the post gateway disconnect netaddress params

func (*PostGatewayDisconnectNetaddressParams) SetNetaddress

func (o *PostGatewayDisconnectNetaddressParams) SetNetaddress(netaddress string)

SetNetaddress adds the netaddress to the post gateway disconnect netaddress params

func (*PostGatewayDisconnectNetaddressParams) SetTimeout

func (o *PostGatewayDisconnectNetaddressParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the post gateway disconnect netaddress params

func (*PostGatewayDisconnectNetaddressParams) WithContext

WithContext adds the context to the post gateway disconnect netaddress params

func (*PostGatewayDisconnectNetaddressParams) WithDefaults added in v0.5.9

WithDefaults hydrates default values in the post gateway disconnect netaddress params (not the query body).

All values with no default are reset to their zero value.

func (*PostGatewayDisconnectNetaddressParams) WithHTTPClient

WithHTTPClient adds the HTTPClient to the post gateway disconnect netaddress params

func (*PostGatewayDisconnectNetaddressParams) WithNetaddress

WithNetaddress adds the netaddress to the post gateway disconnect netaddress params

func (*PostGatewayDisconnectNetaddressParams) WithTimeout

WithTimeout adds the timeout to the post gateway disconnect netaddress params

func (*PostGatewayDisconnectNetaddressParams) WriteToRequest

WriteToRequest writes these params to a swagger request

type PostGatewayDisconnectNetaddressReader

type PostGatewayDisconnectNetaddressReader struct {
	// contains filtered or unexported fields
}

PostGatewayDisconnectNetaddressReader is a Reader for the PostGatewayDisconnectNetaddress structure.

func (*PostGatewayDisconnectNetaddressReader) ReadResponse

func (o *PostGatewayDisconnectNetaddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

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