instantly

package
v0.0.0-...-084c156 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPageSize is number of elements per page.
	DefaultPageSize = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	BaseURL string
	Module  common.Module
	Client  *common.JSONHTTPClient
}

func NewConnector

func NewConnector(opts ...Option) (conn *Connector, outErr error)

func (*Connector) Delete

func (c *Connector) Delete(ctx context.Context, config common.DeleteParams) (*common.DeleteResult, error)

Delete removes object. As of now only removal of Tags are allowed because deletion of other object types require a request payload to be added c.Client.Delete does not yet support this.

func (*Connector) HTTPClient

func (c *Connector) HTTPClient() *common.HTTPClient

func (*Connector) JSONHTTPClient

func (c *Connector) JSONHTTPClient() *common.JSONHTTPClient

JSONHTTPClient returns the underlying JSON HTTP client.

func (*Connector) ListObjectMetadata

func (c *Connector) ListObjectMetadata(
	ctx context.Context, objectNames []string,
) (*common.ListObjectMetadataResult, error)

func (*Connector) Provider

func (c *Connector) Provider() providers.Provider

func (*Connector) Read

func (c *Connector) Read(ctx context.Context, config common.ReadParams) (*common.ReadResult, error)

func (*Connector) String

func (c *Connector) String() string

func (*Connector) Write

func (c *Connector) Write(
	ctx context.Context, config common.WriteParams,
) (*common.WriteResult, error)

Write method allows to * create campaigns * create/update email-accounts * create client Documentation links can be found within constructURLPath function.

type Option

type Option = func(params *parameters)

Option is a function which mutates the connector configuration.

func WithAuthenticatedClient

func WithAuthenticatedClient(client common.AuthenticatedHTTPClient) Option

func WithClient

func WithClient(ctx context.Context, client *http.Client,
	apiKey string,
	opts ...common.QueryParamAuthClientOption,
) Option

type ResponseError

type ResponseError struct {
	// Message usually has API Key query parameter. This shouldn't be returned.
	Message string `json:"message"`
	// Error is very general.
	Error      string `json:"error"`
	StatusCode int    `json:"statusCode"`
}

func (ResponseError) CombineErr

func (r ResponseError) CombineErr(base error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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