Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ClientDriver // AccessToken is the token to attach to the request. AccessToken string // HomeServer is the host part of the homeserver and is treated as the host // for all requests. HomeServer string // HomeServerScheme is the scheme to talk to homeserver on. // It is https most of the time. HomeServerScheme string // contains filtered or unexported fields }
Client is a HTTP client that is Matrix API-aware.
func NewClient ¶
func NewClient() Client
NewClient creates a new Client that uses the default HTTP client.
func NewCustomClient ¶
func NewCustomClient(d ClientDriver) Client
NewCustomClient creates a new Client that uses the provided ClientDriver.
func (*Client) FullRoute ¶ added in v0.3.0
FullRoute creates the full route from the provided route.
type ClientDriver ¶
ClientDriver represents a HTTP client that can make requests to the endpoint.
type Modifier ¶
Modifier modifies the Request before it's sent out to add extra info.
func WithBody ¶
func WithBody(body io.ReadCloser) Modifier
WithBody attaches a io.ReadCloser to the request.
func WithFullQuery ¶
WithFullQuery attaches one-to-many queries to the request.
func WithHeader ¶ added in v0.2.0
WithHeader attaches the provided headers to the request.
func WithJSONBody ¶ added in v0.2.0
func WithJSONBody(body interface{}) Modifier
WithJSONBody attaches a JSON body to the request.
Click to show internal directories.
Click to hide internal directories.