client

package
v3.0.1-test Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultHost is the default Host
	// found in Meta (info) section of spec file
	DefaultHost string = "localhost"
	// DefaultBasePath is the default BasePath
	// found in Meta (info) section of spec file
	DefaultBasePath string = "/santaba/rest"
)

Variables

View Source
var DefaultSchemes = []string{"https"}

DefaultSchemes are the default schemes found in Meta (info) section of spec file

Functions

func BearerAuth

func BearerAuth(bearerToken, userAgent string) runtime.ClientAuthInfoWriter

func GetAuthInfo

func GetAuthInfo(tokenType TokenType, accessID, accessKey, bearerToken, userAgent string) runtime.ClientAuthInfoWriter

func LMBinaryFileConsumer

func LMBinaryFileConsumer() runtime.Consumer

func LMv1Auth

func LMv1Auth(accessId, accessKey, userAgent string) runtime.ClientAuthInfoWriter

Types

type Config

type Config struct {
	AccessKey    *string
	AccessID     *string
	TransportCfg *TransportConfig
	UserAgent    *string
	TokenType    TokenType
	BearerToken  *string
}

Config information for LMSdkGo client

func NewConfig

func NewConfig() *Config

NewConfig create a new empty client Config

func (*Config) SetAccessID

func (c *Config) SetAccessID(accessID *string)

SetAccessID for the client Config

func (*Config) SetAccessKey

func (c *Config) SetAccessKey(accessKey *string)

SetAccessKey for the client Config

func (*Config) SetAccountDomain

func (c *Config) SetAccountDomain(accountDomain *string)

SetAccountDomain for the client Config

func (*Config) SetBearerToken

func (c *Config) SetBearerToken(bearerToken *string)

SetBearerToken for the client Config

func (*Config) SetTokenType

func (c *Config) SetTokenType(tokenType TokenType)

SetTokenType for the client Config

func (*Config) SetUserAgent

func (c *Config) SetUserAgent(userAgent string)

SetUserAgent for the client Config

type LMSdkGo

type LMSdkGo struct {
	LM *lm.Client

	Transport runtime.ClientTransport
}

LMSdkGo is a client for LM sdk go

func New

func New(c *Config) *LMSdkGo

New creates a new LM sdk go client

func (*LMSdkGo) SetTransport

func (c *LMSdkGo) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client and all its subresources

type TokenType

type TokenType int
const (
	LMv1AuthToken TokenType = iota
	BearerToken
)

type TransportConfig

type TransportConfig struct {
	Host     string
	BasePath string
	Schemes  []string
}

TransportConfig contains the transport related info, found in the meta section of the spec file.

func DefaultTransportConfig

func DefaultTransportConfig() *TransportConfig

DefaultTransportConfig creates a TransportConfig with the default settings taken from the meta section of the spec file.

func (*TransportConfig) WithBasePath

func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig

WithBasePath overrides the default basePath, provided by the meta section of the spec file.

func (*TransportConfig) WithHost

func (cfg *TransportConfig) WithHost(host string) *TransportConfig

WithHost overrides the default host, provided by the meta section of the spec file.

func (*TransportConfig) WithSchemes

func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig

WithSchemes overrides the default schemes, provided by the meta section of the spec file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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