auth

package
v0.0.0-...-c436d6b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestAccountAuth

func TestAccountAuth() (types.Authorization, error)

TestAccountAuth gets the test account Authorization

Authorization details are obtained from the "GO_NIXPLAY_TEST_ACCOUNT_USERNAME" and "GO_NIXPLAY_TEST_ACCOUNT_PASSWORD" environment variables. For more details see https://github.com/anitschke/go-nixplay/#testing

Types

type AuthorizedClient

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

AuthorizedClient is a httpx.Client that appends the required headers and cookies when sending requests to Nixplay so that the requests are authorized

It is safe to use AuthorizedClient to requests to other domains as well, when this happens the client will do the right thing and will NOT authorize the request.

func NewAuthorizedClient

func NewAuthorizedClient(ctx context.Context, client httpx.Client, authIn types.Authorization) (*AuthorizedClient, error)

func (*AuthorizedClient) Do

func (c *AuthorizedClient) Do(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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