client

package
v0.0.0-...-ff1469b Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockTestHelper

func MockTestHelper(t *testing.T, table *schema.Table, createServices func(*mux.Router) error, _ TestOptions)

func TeamMultiplex

func TeamMultiplex(meta schema.ClientMeta) []schema.ClientMeta

func TransformWithStruct

func TransformWithStruct(t any, opts ...transformers.StructTransformerOption) schema.Transform

Types

type Client

type Client struct {
	TeamID   string
	TeamIDs  []string
	Services *vercel.Client
	Backend  state.Client
	// contains filtered or unexported fields
}

func New

func New(logger zerolog.Logger, spec Spec, services *vercel.Client, teamIDs []string, bk state.Client) *Client

func (*Client) GetPaginator

func (c *Client) GetPaginator(ctx context.Context, key string, ids ...string) (vercel.Paginator, error)

func (Client) ID

func (c Client) ID() string

func (Client) Logger

func (c Client) Logger() *zerolog.Logger

func (*Client) SavePaginator

func (c *Client) SavePaginator(ctx context.Context, key string, pg vercel.Paginator, ids ...string) error

func (Client) WithTeamID

func (c Client) WithTeamID(teamID string) schema.ClientMeta

type MockHttpClient

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

func NewMockHttpClient

func NewMockHttpClient(cl *http.Client, rootURL string) *MockHttpClient

func (*MockHttpClient) Do

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

type Spec

type Spec struct {
	AccessToken string   `json:"access_token"`
	TeamIDs     []string `json:"team_ids,omitempty"`

	EndpointURL string `json:"endpoint_url,omitempty"`
	Timeout     int64  `json:"timeout_secs,omitempty"`
	PageSize    int64  `json:"page_size,omitempty"`
	MaxRetries  int64  `json:"max_retries,omitempty"`
	MaxWait     int64  `json:"max_wait_secs,omitempty"`

	Concurrency int `json:"concurrency,omitempty"`
}

func (*Spec) SetDefaults

func (s *Spec) SetDefaults()

func (Spec) Validate

func (s Spec) Validate() error

type TestOptions

type TestOptions struct {
	Backend state.State
}

Jump to

Keyboard shortcuts

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