Documentation
¶
Index ¶
- Constants
- func GetApiVersionFromContext(ctx context.Context) string
- func GetCachePath() (string, error)
- func GetClientFromCache() (*client.TygerClient, error)
- func GetServiceMetadata(ctx context.Context, serverUrl string, httpClient *http.Client) (*model.ServiceMetadata, error)
- func InvokePageRequests[T any](ctx context.Context, requestUrl string, queryParams url.Values, totalLimit int, ...) error
- func InvokeRequest(ctx context.Context, method string, relativeUrl string, queryParams url.Values, ...) (*http.Response, error)
- func Login(ctx context.Context, options LoginConfig) (*client.TygerClient, *model.ServiceMetadata, error)
- func Logout() error
- func NormalizeServerUrl(serverUrl string) (*url.URL, error)
- func SetApiVersionOnContext(ctx context.Context, apiVersion string) context.Context
- func SetFieldsOnEntity(ctx context.Context, relativeUrlPath string, queryParams url.Values, ...) error
- type AccessToken
- type InvokeRequestOptionFunc
- type InvokeRequestOptions
- type LoginConfig
Constants ¶
View Source
const ( CacheFileEnvVarName = "TYGER_CACHE_FILE" LocalUrlSentinel = "local" )
View Source
const ( DefaultApiVersion = "1.0" ApiVersionQueryParam = "api-version" )
Variables ¶
This section is empty.
Functions ¶
func GetCachePath ¶
func GetClientFromCache ¶
func GetClientFromCache() (*client.TygerClient, error)
func GetServiceMetadata ¶
func InvokePageRequests ¶
func InvokeRequest ¶
func Login ¶
func Login(ctx context.Context, options LoginConfig) (*client.TygerClient, *model.ServiceMetadata, error)
func SetApiVersionOnContext ¶
Types ¶
type AccessToken ¶
type AccessToken azcore.AccessToken
type InvokeRequestOptionFunc ¶
type InvokeRequestOptionFunc func(*InvokeRequestOptions)
func WithHeaders ¶
func WithHeaders(headers http.Header) InvokeRequestOptionFunc
func WithLeaveResponseOpen ¶
func WithLeaveResponseOpen() InvokeRequestOptionFunc
type InvokeRequestOptions ¶
type LoginConfig ¶
type LoginConfig struct {
ServerUrl string `json:"serverUrl"`
ServicePrincipal string `json:"servicePrincipal,omitempty"`
CertificatePath string `json:"certificatePath,omitempty"`
CertificateThumbprint string `json:"certificateThumbprint,omitempty"`
ManagedIdentity bool `json:"managedIdentity,omitempty"`
ManagedIdentityClientId string `json:"managedIdentityClientId,omitempty"`
GitHub bool `json:"github,omitempty"`
TargetFederatedIdentity string `json:"targetFederatedIdentity,omitempty"`
Proxy string `json:"proxy,omitempty"`
TlsCaCertificates client.TlsCaCertificateSource `json:"tlsCaCertificates,omitempty"`
// These are options for tyger-proxy that are ignored here but we don't want unmarshal to fail if present
Port int `json:"port,omitempty"`
AllowedClientCIDRs []string `json:"allowedClientCIDRs,omitempty"`
LogPath string `json:"logPath,omitempty"`
UseDeviceCode bool `json:"-"`
Persisted bool `json:"-"`
}
func (*LoginConfig) UnmarshalJSON ¶
func (lc *LoginConfig) UnmarshalJSON(data []byte) error
Handle backwards compatibility with `serverUri` instead of `serverUrl`.
Click to show internal directories.
Click to hide internal directories.