client

package
v0.0.0-...-3f507b3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Expired = time.Date(1900, time.January, 1, 0, 0, 0, 0, time.UTC)
)
View Source
var TwispContextKey = TwispContextKeyType("ctx")

Functions

func NewTwispClient

func NewTwispClient(endpoint string, httpClient *http.Client) graphql.Client

NewTwispClient implements a graphql.Client that allows override/merging of Variables sent by the client. This allows Twisp to use graphql variables without having to have every query have typed inputs.

func NewTwispHttp

func NewTwispHttp(customerAccount, twispEnvironment, region string) *http.Client

NewTwispHttp returns an *http.Client that sets authorization and x-twisp-account-id headers. example: NewTwispHttp("Twisp1234", "cloud", "us-east-1")

func NewTwispRoundTripper

func NewTwispRoundTripper(customerAccount, twispEnvironment, region string, now Now) http.RoundTripper

func WithVariables

func WithVariables(ctx context.Context, variables map[string]interface{}) context.Context

WithVariables puts the `variables` on the context and will mix in with the all other variables leaving twisp.

Types

type Now

type Now func() time.Time

type TwispContextKeyType

type TwispContextKeyType string

Jump to

Keyboard shortcuts

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