rjs

package module
v0.0.0-...-fc4206c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 2 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 interface {
	Call(ctx context.Context, uri string, request interface{}, response interface{}) error
}

Client is the interface that makes requests to the RJS API.

uri is the root-relative URI of the API call. Example: "/api/v1/router/info". request is the request message. The implementation sends this object in the request body. response is the response message. The implementation decodes the response body into this object. Returned errors can wrap errors from package encoding/json if JSON encoding/decoding failed, *url.Error if the request failed, or *Error if the server did not accept the request.

type Error

type Error struct {
	StatusCode int
	Body       []byte
}

Error may be returned (possibly wrapped) by implementations of the Client interface.

func (*Error) Error

func (err *Error) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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