auth

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	AuthAPI *AuthAPI
	// contains filtered or unexported fields
}

APIClient manages communication with the Auth API API v0.0.1 endpoints.

func NewAPIClient

func NewAPIClient(cfg *Config) *APIClient

NewAPIClient creates a new API client. If nil is provided for the httpClient

func (*APIClient) AddInterceptor

func (c *APIClient) AddInterceptor(interceptor InterceptFunc)

AddInterceptor adds an interceptor to the APIClient

func (*APIClient) Do

func (c *APIClient) Do(ctx context.Context, req *http.Request) (res *http.Response, err error)

Do send an HTTP request and returns an HTTP response.

type AuthAPI

type AuthAPI api

func (*AuthAPI) GetDomain

func (a *AuthAPI) GetDomain(ctx context.Context, req *GetDomainRequest) (ret *Domain, resp *http.Response, err error)

(GET /org/domain)

type Config

type Config struct {
	BasePath   string            `json:"basePath,omitempty" yaml:"basePath,omitempty"`
	Host       string            `json:"host,omitempty" yaml:"host,omitempty"`
	Headers    map[string]string `yaml:"headers,omitempty" json:"headers,omitempty"`
	UserAgent  string            `json:"userAgent,omitempty" yaml:"userAgent,omitempty"`
	HTTPClient *http.Client
}

Config stores configuration for API client

func NewConfig

func NewConfig() *Config

type Domain

type Domain struct {
	ID             int    `json:"id,omitempty"`
	LocalCurrency  string `json:"local_currency,omitempty"`
	Name           string `json:"name,omitempty"`
	ParentCurrency string `json:"parent_currency,omitempty"`
	// ParentID the top-level parent domain id
	ParentID int `json:"parent_id,omitempty"`
	// ParentName the top-level parent domain name
	ParentName string `json:"parent_name,omitempty"`
}

type Error

type Error struct {
	Code    int    `json:"code,omitempty"`
	Details string `json:"details,omitempty"`
	Message string `json:"message,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Errors []*Error `json:"errors,omitempty"`
}

type GetDomainRequest

type GetDomainRequest struct {
	OrgID int `binding:"required" form:"orgID"`
}

GetDomainRequest is the request object for (GET /org/domain)

type InterceptFunc

type InterceptFunc func(context.Context, *http.Request) error

InterceptFunc is a function that intercepts a request before it is sent.

Jump to

Keyboard shortcuts

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