goluminate

package
v0.0.0-...-b699e8b Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: BSD-3-Clause Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppCreateResponse

type AppCreateResponse struct {
	ID                    string      `json:"id"`
	CreatedOn             int64       `json:"createdOn"`
	ModifiedOn            int64       `json:"modifiedOn"`
	Name                  string      `json:"name"`
	Description           interface{} `json:"description"`
	Type                  string      `json:"type"`
	Icon                  interface{} `json:"icon"`
	IsVisible             bool        `json:"isVisible"`
	IsNotificationEnabled bool        `json:"isNotificationEnabled"`
	ConnectionSettings    struct {
		InternalAddress                  string      `json:"internalAddress"`
		InternalSSLCertificatePublicHalf interface{} `json:"internalSSLCertificatePublicHalf"`
		ExternalAddress                  string      `json:"externalAddress"`
		CustomExternalAddress            interface{} `json:"customExternalAddress"`
		LuminateAddress                  string      `json:"luminateAddress"`
		CustomSSLCertificate             interface{} `json:"customSSLCertificate"`
		AuthenticationType               string      `json:"authenticationType"`
		SsoSettings                      struct {
		} `json:"ssoSettings"`
		CustomRootPath interface{} `json:"customRootPath"`
		HealthURL      string      `json:"healthUrl"`
		HealthMethod   string      `json:"healthMethod"`
		Subdomain      string      `json:"subdomain"`
	} `json:"connectionSettings"`
	SiteSettings struct {
		SiteID string `json:"siteId"`
	} `json:"siteSettings"`
	LinkTranslationSettings struct {
		BaseURL                             interface{} `json:"baseUrl"`
		IsDefaultContentRewriteRulesEnabled bool        `json:"isDefaultContentRewriteRulesEnabled"`
		IsDefaultHeaderRewriteRulesEnabled  bool        `json:"isDefaultHeaderRewriteRulesEnabled"`
		UseExternalAddressForHostAndSni     bool        `json:"useExternalAddressForHostAndSni"`
		CharsetEncoding                     interface{} `json:"charsetEncoding"`
		LinkedApplications                  interface{} `json:"linkedApplications"`
		DefaultRewriteRules                 interface{} `json:"defaultRewriteRules"`
		CustomRewriteRules                  interface{} `json:"customRewriteRules"`
	} `json:"linkTranslationSettings"`
	Health struct {
		ApplicationID                    string      `json:"applicationId"`
		Status                           string      `json:"status"`
		Cause                            interface{} `json:"cause"`
		LastUpdatedOn                    interface{} `json:"lastUpdatedOn"`
		TotalNumberOfConnectors          int         `json:"totalNumberOfConnectors"`
		TotalNumberOfAvailableConnectors int         `json:"totalNumberOfAvailableConnectors"`
		ConnectorsStatus                 interface{} `json:"connectorsStatus"`
		LastAvailableOn                  interface{} `json:"lastAvailableOn"`
	} `json:"health"`
	SSHSettings struct {
		UserAccounts []interface{} `json:"userAccounts"`
	} `json:"sshSettings"`
	RequestCustomizationSettings struct {
		HeaderCustomization struct {
			XForwardedHost  string `json:"X-Forwarded-Host"`
			XForwardedFor   string `json:"X-Forwarded-For"`
			XForwardedProto string `json:"X-Forwarded-Proto"`
		} `json:"headerCustomization"`
	} `json:"requestCustomizationSettings"`
}

type AppHttpCreateRequest

type AppHttpCreateRequest struct {
	ConnectionSettings struct {
		InternalAddress string `json:"internalAddress"`
		CustomRootPath  string `json:"customRootPath"`
		HealthURL       string `json:"healthUrl"`
		HealthMethod    string `json:"healthMethod"`
	} `json:"connectionSettings"`
	Type                    string `json:"type"`
	Name                    string `json:"name"`
	IsVisible               bool   `json:"isVisible"`
	IsNotificationEnabled   bool   `json:"isNotificationEnabled"`
	LinkTranslationSettings struct {
		IsDefaultContentRewriteRulesEnabled bool          `json:"isDefaultContentRewriteRulesEnabled"`
		IsDefaultHeaderRewriteRulesEnabled  bool          `json:"isDefaultHeaderRewriteRulesEnabled"`
		UseExternalAddressForHostAndSni     bool          `json:"useExternalAddressForHostAndSni"`
		LinkedApplications                  []interface{} `json:"linkedApplications"`
	} `json:"linkTranslationSettings"`
	RequestCustomizationSettings struct {
		XForwardedFor   string `json:"X-Forwarded-For"`
		XForwardedHost  string `json:"X-Forwarded-Host"`
		XForwardedProto string `json:"X-Forwarded-Proto"`
	} `json:"requestCustomizationSettings"`
}

type AppSshCreateRequest

type AppSshCreateRequest struct {
	Type                  string `json:"type"`
	Name                  string `json:"name"`
	IsVisible             bool   `json:"isVisible"`
	IsNotificationEnabled bool   `json:"isNotificationEnabled"`
	ConnectionSettings    struct {
		InternalAddress string `json:"internalAddress"`
	} `json:"connectionSettings"`
	SSHSettings struct {
		UserAccounts []SshUserAccounts `json:"userAccounts"`
	} `json:"sshSettings"`
}

type AppTcpCreateRequest

type AppTcpCreateRequest struct {
	Type                  string `json:"type"`
	Name                  string `json:"name"`
	IsVisible             bool   `json:"isVisible"`
	IsNotificationEnabled bool   `json:"isNotificationEnabled"`
	ConnectionSettings    struct {
		Subdomain string `json:"subdomain"`
	} `json:"connectionSettings"`
	TcpTunnelSettings []TcpTunnelSettings `json:"tcpTunnelSettings"`
}

type ApplicationList

type ApplicationList struct {
	Content []struct {
		ID                    string      `json:"id"`
		CreatedOn             int64       `json:"createdOn"`
		ModifiedOn            int64       `json:"modifiedOn"`
		Name                  string      `json:"name"`
		Description           interface{} `json:"description"`
		Type                  string      `json:"type"`
		Icon                  interface{} `json:"icon"`
		IsVisible             bool        `json:"isVisible"`
		IsNotificationEnabled bool        `json:"isNotificationEnabled"`
		ConnectionSettings    struct {
			InternalAddress                  string      `json:"internalAddress"`
			InternalSSLCertificatePublicHalf interface{} `json:"internalSSLCertificatePublicHalf"`
			ExternalAddress                  string      `json:"externalAddress"`
			CustomExternalAddress            interface{} `json:"customExternalAddress"`
			LuminateAddress                  string      `json:"luminateAddress"`
			CustomSSLCertificate             interface{} `json:"customSSLCertificate"`
			AuthenticationType               string      `json:"authenticationType"`
			SsoSettings                      struct {
			} `json:"ssoSettings"`
			CustomRootPath interface{} `json:"customRootPath"`
			HealthURL      interface{} `json:"healthUrl"`
			HealthMethod   string      `json:"healthMethod"`
			Subdomain      string      `json:"subdomain"`
		} `json:"connectionSettings"`
		SiteSettings struct {
			SiteID string `json:"siteId"`
		} `json:"siteSettings"`
		LinkTranslationSettings struct {
			BaseURL                             interface{}   `json:"baseUrl"`
			IsDefaultContentRewriteRulesEnabled bool          `json:"isDefaultContentRewriteRulesEnabled"`
			IsDefaultHeaderRewriteRulesEnabled  bool          `json:"isDefaultHeaderRewriteRulesEnabled"`
			UseExternalAddressForHostAndSni     interface{}   `json:"useExternalAddressForHostAndSni"`
			CharsetEncoding                     interface{}   `json:"charsetEncoding"`
			LinkedApplications                  []interface{} `json:"linkedApplications"`
			DefaultRewriteRules                 interface{}   `json:"defaultRewriteRules"`
			CustomRewriteRules                  interface{}   `json:"customRewriteRules"`
		} `json:"linkTranslationSettings"`
		Health struct {
			ApplicationID                    string `json:"applicationId"`
			Status                           string `json:"status"`
			Cause                            string `json:"cause"`
			LastUpdatedOn                    int64  `json:"lastUpdatedOn"`
			TotalNumberOfConnectors          int    `json:"totalNumberOfConnectors"`
			TotalNumberOfAvailableConnectors int    `json:"totalNumberOfAvailableConnectors"`
			ConnectorsStatus                 []struct {
				ConnectorID string `json:"connectorId"`
				IsHealthy   bool   `json:"isHealthy"`
			} `json:"connectorsStatus"`
			LastAvailableOn int64 `json:"lastAvailableOn"`
		} `json:"health"`
		SSHSettings struct {
			UserAccounts []interface{} `json:"userAccounts"`
		} `json:"sshSettings"`
		RequestCustomizationSettings struct {
			HeaderCustomization struct {
				XForwardedFor   string `json:"X-Forwarded-For"`
				XForwardedHost  string `json:"X-Forwarded-Host"`
				XForwardedProto string `json:"X-Forwarded-Proto"`
			} `json:"headerCustomization"`
		} `json:"requestCustomizationSettings"`
		TCPTunnelSettings []struct {
			Target string `json:"target"`
			Ports  []int  `json:"ports"`
		} `json:"tcpTunnelSettings,omitempty"`
	} `json:"content"`
	TotalElements int  `json:"totalElements"`
	TotalPages    int  `json:"totalPages"`
	Last          bool `json:"last"`
	First         bool `json:"first"`
	Sort          []struct {
		Direction    string `json:"direction"`
		Property     string `json:"property"`
		IgnoreCase   bool   `json:"ignoreCase"`
		NullHandling string `json:"nullHandling"`
		Ascending    bool   `json:"ascending"`
		Descending   bool   `json:"descending"`
	} `json:"sort"`
	NumberOfElements int `json:"numberOfElements"`
	Size             int `json:"size"`
	Number           int `json:"number"`
}

type Client

type Client struct {
	// The base-URL that should be used should be api.<tenant-name>.luminatesec.com.
	BaseURL   *url.URL
	UserAgent string // User agent used when communicating with the luminate API.
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, ClientID, ClientSecret, TenantName string) *Client

https://luminatepublicapi.docs.apiary.io/#introduction/authorization NewClient returns a new luminate API client with provided base URL.

func (*Client) CreateSite

func (c *Client) CreateSite(ctx context.Context, site NewSiteRequest) (*NewSiteResponse, *http.Response, error)

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, target interface{}) (*http.Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by target, or returned as an error if an API error has occurred. If target implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.

The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

type ConnectorCommandRequest

type ConnectorCommandRequest struct {
	ConnectorName         string `json:"connector_name"`
	KerberosConfiguration struct {
		Domain     string `json:"domain"`
		KdcAddress string `json:"kdc_address"`
		KeytabPath string `json:"keytab_path"`
	} `json:"kerberos_configuration"`
}

type ConnectorCommandResponse

type ConnectorCommandResponse struct {
	Linux         string `json:"linux"`
	Windows       string `json:"windows"`
	DockerCompose string `json:"docker_compose"`
	K8S           string `json:"k8s"`
}

type NewConnectorRequest

type NewConnectorRequest struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type NewConnectorResponse

type NewConnectorResponse struct {
	ID               string    `json:"id"`
	Name             string    `json:"name"`
	Version          string    `json:"version"`
	Registered       bool      `json:"registered"`
	Otp              string    `json:"otp"`
	DateCreated      time.Time `json:"date_created"`
	DateRegistered   time.Time `json:"date_registered"`
	DateOtpExpire    time.Time `json:"date_otp_expire"`
	SendLogs         bool      `json:"send_logs"`
	ConnectorStatus  string    `json:"connector_status"`
	UpdateMode       string    `json:"update_mode"`
	UpdateStatus     string    `json:"update_status"`
	UpdateStatusInfo string    `json:"update_status_info"`
}

type NewSiteRequest

type NewSiteRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Settings    struct {
		ProxyAddress  string `json:"proxyAddress"`
		ProxyPort     int    `json:"proxyPort"`
		ProxyUsername string `json:"proxyUsername"`
		ProxyPassword string `json:"proxyPassword"`
	} `json:"settings"`
	Connectors             []interface{} `json:"connectors"`
	MuteHealthNotification bool          `json:"mute_health_notification"`
}

type NewSiteResponse

type NewSiteResponse struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Settings    struct {
		ProxyAddress  string `json:"proxyAddress"`
		ProxyPort     int    `json:"proxyPort"`
		ProxyUsername string `json:"proxyUsername"`
		ProxyPassword string `json:"proxyPassword"`
	} `json:"settings"`
	Connectors       []interface{} `json:"connectors"`
	ConnectorObjects []interface{} `json:"connector_objects"`
	UpdateMode       string        `json:"update_mode"`
	SiteStatus       struct {
		ConnectorsUp            []interface{} `json:"ConnectorsUp"`
		ConnectorsDown          []interface{} `json:"ConnectorsDown"`
		ConnectorsNotConfigured []interface{} `json:"ConnectorsNotConfigured"`
		Status                  string        `json:"Status"`
	} `json:"site_status"`
	DownSince              string `json:"down_since"`
	MuteHealthNotification bool   `json:"mute_health_notification"`
}

type SshUserAccounts

type SshUserAccounts struct {
	Name string `json:"name"`
}

type TcpTunnelSettings

type TcpTunnelSettings struct {
	Target string   `json:"target"`
	Ports  []string `json:"ports"`
}

Jump to

Keyboard shortcuts

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