transport

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CellsApiResourcePath = "/a"
	CellsS3SecretDefault = "gatewaysecret"
)

Variables

This section is empty.

Functions

func LoadAccessToken

func LoadAccessToken(c *cells_sdk.SdkConfig) (string, error)

func New

func New(options ...interface{}) http.RoundTripper

Types

type FrontSessionTokenProvider

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

func (*FrontSessionTokenProvider) Expired

func (f *FrontSessionTokenProvider) Expired() bool

func (*FrontSessionTokenProvider) Retrieve

func (f *FrontSessionTokenProvider) Retrieve() (string, error)

type Option

type Option func(t *http.Transport) *http.Transport

func WithSkipVerify

func WithSkipVerify(skip bool) Option

type RoundTripOption

type RoundTripOption func(t http.RoundTripper) http.RoundTripper

func WithBearer

func WithBearer(provider TokenProvider) RoundTripOption

func WithCustomHeaders

func WithCustomHeaders(h map[string]string) RoundTripOption

type StaticTokenProvider

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

func (*StaticTokenProvider) Expired

func (t *StaticTokenProvider) Expired() bool

func (*StaticTokenProvider) Retrieve

func (t *StaticTokenProvider) Retrieve() (string, error)

type TokenProvider

type TokenProvider interface {
	Retrieve() (string, error)
	Expired() bool
}

func NewFrontSessionTokenProvider

func NewFrontSessionTokenProvider(c *cells_sdk.SdkConfig) (TokenProvider, error)

func NewStaticTokenProvider

func NewStaticTokenProvider(token string) TokenProvider

func TokenProviderFromConfig

func TokenProviderFromConfig(c *cells_sdk.SdkConfig) (TokenProvider, error)

func WithProviderCache

func WithProviderCache(provider TokenProvider, c *cells_sdk.SdkConfig) TokenProvider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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