citrixclient

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 22 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
	AuthConfig          *AuthenticationConfiguration
	ClientConfig        *ClientConfiguration
	WemOnPremAuthConfig *WemOnPremAuthentication
	AuthToken           *AuthTokenModel
	StorefrontClient    *storefrontapis.APIClient
	QuickCreateClient   *citrixquickcreate.APIClient
	WemClient           *citrixwemservice.APIClient
	// Citrix Cloud Service Clients
	CCAdminsClient          *ccadmins.APIClient
	CwsClient               *citrixcws.APIClient
	GacClient               *globalappconfiguration.APIClient
	ResourceLocationsClient *resourcelocations.APIClient
}

func (*CitrixDaasClient) GetBatchRequestItemRelativeUrl added in v0.2.7

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

func (*CitrixDaasClient) InitializeCitrixCloudClients added in v1.0.6

func (daasClient *CitrixDaasClient) InitializeCitrixCloudClients(ctx context.Context, ccUrl, hostname string, middlewareFunc MiddlewareAuthFunction, middlewareFuncWithCustomerIdHeader MiddlewareAuthFunction)

func (*CitrixDaasClient) InitializeCitrixDaasClient added in v1.0.5

func (daasClient *CitrixDaasClient) InitializeCitrixDaasClient(ctx context.Context, customerId, token string, onPremises bool, apiGateway bool, disableSslVerification bool, userAgent *string) (*http.Response, error)

func (*CitrixDaasClient) InitializeCwsClient added in v1.0.5

func (daasClient *CitrixDaasClient) InitializeCwsClient(ctx context.Context, cwsHostname string, middlewareFunc MiddlewareAuthFunction)

func (*CitrixDaasClient) InitializeQuickCreateClient added in v1.0.5

func (daasClient *CitrixDaasClient) InitializeQuickCreateClient(ctx context.Context, quickCreateHostName string, middlewareFunc MiddlewareAuthFunction)

func (*CitrixDaasClient) InitializeStoreFrontClient added in v1.0.5

func (daasClient *CitrixDaasClient) InitializeStoreFrontClient(ctx context.Context, computerName, adUserName, adUserPass string, disableSslVerification bool)

func (*CitrixDaasClient) InitializeWemClient added in v1.0.7

func (daasClient *CitrixDaasClient) InitializeWemClient(ctx context.Context, wemHostName string, middlewareFunc MiddlewareAuthFunction, onPremises, disableSslVerification bool)

------ Setup WEM Client ------

func (*CitrixDaasClient) SetupApiClient added in v1.0.6

func (daasClient *CitrixDaasClient) SetupApiClient(hostname string, middlewareFunc MiddlewareAuthFunction, onPremises, disableSslVerification, apiGateway bool)

------ Setup API Client ------

func (*CitrixDaasClient) SetupAuthConfig added in v1.0.6

func (daasClient *CitrixDaasClient) SetupAuthConfig(authUrl, clientId, clientSecret string, onPremises, apiGateway, isGov bool)

------ Setup Authentication Configuration ------

func (*CitrixDaasClient) SetupCCAdminClient added in v1.0.6

func (daasClient *CitrixDaasClient) SetupCCAdminClient(ccUrl string, middlewareFunc MiddlewareAuthFunction)

------ Setup CC Admin Client ------

func (*CitrixDaasClient) SetupCitrixClientsContext added in v1.0.6

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

func (*CitrixDaasClient) SetupGacClient added in v1.0.6

func (daasClient *CitrixDaasClient) SetupGacClient(hostname string, middlewareFunc MiddlewareAuthFunction)

------ Setup GAC Client ------

func (*CitrixDaasClient) SetupResourceLocationsClient added in v1.0.6

func (daasClient *CitrixDaasClient) SetupResourceLocationsClient(ccUrl string, middlewareFunc MiddlewareAuthFunction)

------ Setup Resource Locations Client ------

func (*CitrixDaasClient) SetupWemOnPremAuthConfig added in v1.0.8

func (daasClient *CitrixDaasClient) SetupWemOnPremAuthConfig(authUrl, adminUserName, adminPassword string)

------ Setup Wem On-Prem Authentication Configuration ------

func (*CitrixDaasClient) SetupWemOnPremClientContext added in v1.0.8

func (daasClient *CitrixDaasClient) SetupWemOnPremClientContext(ctx context.Context, middlewareFunc MiddlewareAuthFunction, wemAuthUrl, wemHostName, wemAdminUserName, wemAdminPassword string, disableSslVerification bool)

func (*CitrixDaasClient) SignIn

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

SignIn - Get a new token for user

func (*CitrixDaasClient) SignInWemOnPrem added in v1.0.8

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

SignIn to Wem OnPrem Host to get Session ID

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
	IsCspCustomer           bool
}

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 -

type WemOnPremAuthResponse added in v1.0.8

type WemOnPremAuthResponse struct {
	Sid       string `json:"sid"`
	UserName  string `json:"userName"`
	SessionId string `json:"sessionId"`
}

Wem On-Prem Auth Response with Session ID

type WemOnPremAuthentication added in v1.0.8

type WemOnPremAuthentication struct {
	AuthUrl       string `json:"auth_url"`
	AdminUserName string `json:"admin_username"`
	AdminPassword string `json:"admin_password"`
}

WemOnPremAuthentication provides authentication settings for WEM on-premises service

Jump to

Keyboard shortcuts

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