adminapi

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvAPIBaseURL = "GUMROAD_ADMIN_API_BASE_URL"
)

Variables

This section is empty.

Functions

func AdminPath

func AdminPath(path string) string

AdminPath returns the absolute admin-prefixed path for path.

func AdminTokensURL added in v0.4.0

func AdminTokensURL() string

Types

type AdminToken added in v0.4.0

type AdminToken struct {
	Token           string            `json:"token"`
	TokenExternalID string            `json:"token_external_id"`
	Actor           adminconfig.Actor `json:"actor"`
	ExpiresAt       string            `json:"expires_at"`
}

func ExchangeAuthorizationCode added in v0.4.0

func ExchangeAuthorizationCode(ctx context.Context, code, codeVerifier, version string, debug bool) (AdminToken, error)

type Client

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

func NewClientWithBaseURL

func NewClientWithBaseURL(ctx context.Context, token, version string, debug bool, baseURL string) *Client

func NewClientWithContext

func NewClientWithContext(ctx context.Context, token, version string, debug bool) *Client

func (*Client) Delete

func (c *Client) Delete(path string, params url.Values) (json.RawMessage, error)

func (*Client) Get

func (c *Client) Get(path string, params url.Values) (json.RawMessage, error)

func (*Client) Post

func (c *Client) Post(path string, params url.Values) (json.RawMessage, error)

func (*Client) PostJSON

func (c *Client) PostJSON(path string, payload any) (json.RawMessage, error)

func (*Client) Put

func (c *Client) Put(path string, params url.Values) (json.RawMessage, error)

func (*Client) PutJSON

func (c *Client) PutJSON(path string, payload any) (json.RawMessage, error)

func (*Client) RevokeSelf added in v0.4.0

func (c *Client) RevokeSelf() error

func (*Client) SetDebugWriter

func (c *Client) SetDebugWriter(w io.Writer)

func (*Client) Whoami added in v0.4.0

func (c *Client) Whoami() (WhoamiResponse, error)

type TokenMetadata added in v0.4.0

type TokenMetadata struct {
	ExternalID string `json:"external_id"`
	ExpiresAt  string `json:"expires_at"`
}

type WhoamiResponse added in v0.4.0

type WhoamiResponse struct {
	Actor  adminconfig.Actor `json:"actor"`
	Token  TokenMetadata     `json:"token"`
	Scopes []string          `json:"scopes"`
}

Jump to

Keyboard shortcuts

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