citrixclient

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestData added in v0.2.0

func AddRequestData[T any](request T, c *CitrixDaasClient) T

func ExecuteWithRetry added in v0.2.5

func ExecuteWithRetry[ResponseBodyType any](request any, c *CitrixDaasClient) (ResponseBodyType, *http.Response, error)

func GetJobIdFromHttpResponse added in v0.2.6

func GetJobIdFromHttpResponse(httpResponse http.Response) string

func GetTransactionIdFromHttpResponse added in v0.2.6

func GetTransactionIdFromHttpResponse(httpResponse *http.Response) string

func PerformBatchOperation added in v0.2.6

func PerformBatchOperation(ctx context.Context, client *CitrixDaasClient, batchRequestModel citrixorchestration.BatchRequestModel) (int, string, error)

func RetryOperationWithExponentialBackOff added in v0.2.3

func RetryOperationWithExponentialBackOff[T any](operation func() (T, *http.Response, error), baseDelayInSeconds int, maxRetries int) (T, *http.Response, error)

func RetryOperationWithExponentialBackOffDefault added in v0.2.5

func RetryOperationWithExponentialBackOffDefault[T any](operation func() (T, *http.Response, error)) (T, *http.Response, error)

Types

type AuthTokenModel

type AuthTokenModel struct {
	Token     string `json:"access_token"`
	ExpiresAt string `json:"expires_in"`
}

type AuthenticationConfiguration

type AuthenticationConfiguration struct {
	AuthUrl      string `json:"auth_url"`
	ClientId     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	OnPremises   bool   `json:"on_premises"`
	ApiGateway   bool   `json:"api_gateway"`
	IsGov        bool   `json:"is_gov"`
}

AuthenticationConfiguration provides authentication settings for CC Athena / on-premises trust service

type CCAuthResponse

type CCAuthResponse struct {
	TokenType        string `json:"token_type"`
	Token            string `json:"access_token"`
	Expiration       string `json:"expires_in"`
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

AuthResponse -

type CCTrustAuthResponse added in v0.2.7

type CCTrustAuthResponse struct {
	Token      string `json:"Token"`
	Principal  string `json:"Principal"`
	UserId     string `json:"UserId"`
	CustomerId string `json:"CustomerId"`
	ExpiresAt  int    `json:"ExpiresAt"`
}

AuthResponse -

type CitrixDaasClient

type CitrixDaasClient struct {
	ApiClient               *citrixorchestration.APIClient
	GacClient               *globalappconfiguration.APIClient
	ResourceLocationsClient *resourcelocations.APIClient
	AuthConfig              *AuthenticationConfiguration
	ClientConfig            *ClientConfiguration
	AuthToken               *AuthTokenModel
	StorefrontClient        *storefrontapis.APIClient
}

func NewCitrixDaasClient

func NewCitrixDaasClient(ctx context.Context, authUrl, ccUrl, hostname, customerId, clientId, clientSecret string, onPremises bool, apiGateway bool, isGov bool, disableSslVerification bool, userAgent *string, middlewareFunc MiddlewareAuthFunction) (*CitrixDaasClient, *http.Response, error)

func NewStoreFrontClient added in v0.4.0

func NewStoreFrontClient(ctx context.Context, computerName, adUserName, adUserPass string, daasClient *CitrixDaasClient) *CitrixDaasClient

func (*CitrixDaasClient) GetBatchRequestItemRelativeUrl added in v0.2.7

func (c *CitrixDaasClient) GetBatchRequestItemRelativeUrl(relativeUrl string) string

func (*CitrixDaasClient) SignIn

func (c *CitrixDaasClient) SignIn() (string, *http.Response, error)

SignIn - Get a new token for user

func (*CitrixDaasClient) WaitForJob

func (c *CitrixDaasClient) WaitForJob(ctx context.Context, jobId string, maxWaitTimeInMinutes int) (*citrixorchestration.JobResponseModel, error)

type ClientConfiguration

type ClientConfiguration struct {
	CustomerId              string
	SiteId                  string
	UserAgent               string
	Accept                  string
	Authorization           string
	OrchestrationApiVersion int32
	ProductVersion          string
}

ClientConfiguration provides Citrix DaaS customer context

type MiddlewareAuthFunction added in v0.2.0

type MiddlewareAuthFunction func(authClient *CitrixDaasClient, r *http.Request)

MiddlewareAuthFunction provides way to implement custom middleware which can do auth

type TrustAuthResponse

type TrustAuthResponse struct {
	Token      string `json:"Token"`
	Principal  string `json:"Principal"`
	UserId     string `json:"UserId"`
	CustomerId string `json:"CustomerId"`
	ExpiresAt  string `json:"ExpiresAt"`
}

AuthResponse -

Jump to

Keyboard shortcuts

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