controlplane

package
v0.0.0-...-7aeb7b1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheFileEnvVarName = "TYGER_CACHE_FILE"

	LocalUriSentinel = "local"
)

Variables

This section is empty.

Functions

func GetCachePath

func GetCachePath() (string, error)

func GetClientFromCache

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

func InvokePageRequests

func InvokePageRequests[T any](ctx context.Context, uri string, limit int, warnIfTruncated bool) error

func InvokeRequest

func InvokeRequest(ctx context.Context, method string, relativeUri string, input interface{}, output interface{}, options ...InvokeRequestOptionFunc) (*http.Response, error)

func Login

func Login(ctx context.Context, options LoginConfig) (*client.TygerClient, error)

func Logout

func Logout() error

func NormalizeServerUri

func NormalizeServerUri(uri string) (*url.URL, error)

Types

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 {
	ServerUri                       string `json:"serverUri"`
	ServicePrincipal                string `json:"servicePrincipal,omitempty"`
	CertificatePath                 string `json:"certificatePath,omitempty"`
	CertificateThumbprint           string `json:"certificateThumbprint,omitempty"`
	Proxy                           string `json:"proxy,omitempty"`
	DisableTlsCertificateValidation bool   `json:"disableTlsCertificateValidation,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:"-"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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