xrpc

package
v0.0.0-...-8755c74 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0, MIT Imports: 13 Imported by: 46

Documentation

Index

Constants

View Source
const (
	Query = XRPCRequestType(iota)
	Procedure
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthInfo

type AuthInfo struct {
	AccessJwt  string `json:"accessJwt"`
	RefreshJwt string `json:"refreshJwt"`
	Handle     string `json:"handle"`
	Did        string `json:"did"`
}

type Client

type Client struct {
	// Client is an HTTP client to use. If not set, defaults to http.RobustHTTPClient().
	Client     *http.Client
	Auth       *AuthInfo
	AdminToken *string
	Host       string
	UserAgent  *string
	Headers    map[string]string
}

func (*Client) Do

func (c *Client) Do(ctx context.Context, kind XRPCRequestType, inpenc string, method string, params map[string]interface{}, bodyobj interface{}, out interface{}) error

type Error

type Error struct {
	StatusCode int
	Wrapped    error
	Ratelimit  *RatelimitInfo
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) IsThrottled

func (e *Error) IsThrottled() bool

func (*Error) Unwrap

func (e *Error) Unwrap() error

type RatelimitInfo

type RatelimitInfo struct {
	Limit     int
	Remaining int
	Policy    string
	Reset     time.Time
}

type XRPCError

type XRPCError struct {
	ErrStr  string `json:"error"`
	Message string `json:"message"`
}

func (*XRPCError) Error

func (xe *XRPCError) Error() string

type XRPCRequestType

type XRPCRequestType int

Jump to

Keyboard shortcuts

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