controlplane

package
v0.0.0-...-ed3f6ae Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

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 GetApiVersionFromContext

func GetApiVersionFromContext(ctx context.Context) string

func GetCachePath

func GetCachePath() (string, error)

func GetClientFromCache

func GetClientFromCache() (*client.TygerClient, error)

func GetServiceMetadata

func GetServiceMetadata(ctx context.Context, serverUrl string, httpClient *http.Client) (*model.ServiceMetadata, error)

func InvokePageRequests

func InvokePageRequests[T any](ctx context.Context, requestUrl string, queryParams url.Values, totalLimit int, warnIfTruncated bool) error

func InvokeRequest

func InvokeRequest(ctx context.Context, method string, relativeUrl string, queryParams url.Values, input any, output any, options ...InvokeRequestOptionFunc) (*http.Response, error)

func Logout

func Logout() error

func NormalizeServerUrl

func NormalizeServerUrl(serverUrl string) (*url.URL, error)

func SetApiVersionOnContext

func SetApiVersionOnContext(ctx context.Context, apiVersion string) context.Context

func SetFieldsOnEntity

func SetFieldsOnEntity(ctx context.Context, relativeUrlPath string, queryParams url.Values, etag string, clearTags bool, tags map[string]string, expiresAt *time.Time, reponseObject any) error

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 InvokeRequestOptions struct {
	Headers           http.Header
	LeaveResponseOpen bool
}

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`.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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