Documentation ¶
Index ¶
- type ACP
- type APIError
- type APIService
- type Client
- func (c *Client) CreateACP(ctx context.Context, policy *hubv1alpha1.AccessControlPolicy) (*acp.ACP, error)
- func (c *Client) CreateAPI(ctx context.Context, createReq *CreateAPIReq) (*api.API, error)
- func (c *Client) CreateAccess(ctx context.Context, createReq *CreateAccessReq) (*api.Access, error)
- func (c *Client) CreateCollection(ctx context.Context, createReq *CreateCollectionReq) (*api.Collection, error)
- func (c *Client) CreateEdgeIngress(ctx context.Context, createReq *CreateEdgeIngressReq) (*edgeingress.EdgeIngress, error)
- func (c *Client) CreateGateway(ctx context.Context, createReq *CreateGatewayReq) (*api.Gateway, error)
- func (c *Client) CreatePortal(ctx context.Context, createReq *CreatePortalReq) (*api.Portal, error)
- func (c *Client) DeleteACP(ctx context.Context, oldVersion, name string) error
- func (c *Client) DeleteAPI(ctx context.Context, namespace, name, lastKnownVersion string) error
- func (c *Client) DeleteAccess(ctx context.Context, name, lastKnownVersion string) error
- func (c *Client) DeleteCollection(ctx context.Context, name, lastKnownVersion string) error
- func (c *Client) DeleteEdgeIngress(ctx context.Context, namespace, name, lastKnownVersion string) error
- func (c *Client) DeleteGateway(ctx context.Context, name, lastKnownVersion string) error
- func (c *Client) DeletePortal(ctx context.Context, name, lastKnownVersion string) error
- func (c *Client) FetchTopology(ctx context.Context) (topology state.Cluster, topoVersion int64, err error)
- func (c *Client) GetACPs(ctx context.Context) ([]acp.ACP, error)
- func (c *Client) GetAPIs(ctx context.Context) ([]api.API, error)
- func (c *Client) GetAccesses(ctx context.Context) ([]api.Access, error)
- func (c *Client) GetCertificateByDomains(ctx context.Context, domains []string) (edgeingress.Certificate, error)
- func (c *Client) GetCollections(ctx context.Context) ([]api.Collection, error)
- func (c *Client) GetConfig(ctx context.Context) (Config, error)
- func (c *Client) GetEdgeIngresses(ctx context.Context) ([]edgeingress.EdgeIngress, error)
- func (c *Client) GetGateways(ctx context.Context) ([]api.Gateway, error)
- func (c *Client) GetPortals(ctx context.Context) ([]api.Portal, error)
- func (c *Client) GetWildcardCertificate(ctx context.Context) (edgeingress.Certificate, error)
- func (c *Client) Link(ctx context.Context, kubeID string) (string, error)
- func (c *Client) ListPendingCommands(ctx context.Context) ([]Command, error)
- func (c *Client) ListVerifiedDomains(ctx context.Context) ([]string, error)
- func (c *Client) PatchTopology(ctx context.Context, patch []byte, lastKnownVersion int64) (int64, error)
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) SetVersionStatus(ctx context.Context, status version.Status) error
- func (c *Client) SubmitCommandReports(ctx context.Context, reports []CommandExecutionReport) error
- func (c *Client) UpdateACP(ctx context.Context, oldVersion string, ...) (*acp.ACP, error)
- func (c *Client) UpdateAPI(ctx context.Context, namespace, name, lastKnownVersion string, ...) (*api.API, error)
- func (c *Client) UpdateAccess(ctx context.Context, name, lastKnownVersion string, updateReq *UpdateAccessReq) (*api.Access, error)
- func (c *Client) UpdateCollection(ctx context.Context, name, lastKnownVersion string, ...) (*api.Collection, error)
- func (c *Client) UpdateEdgeIngress(ctx context.Context, namespace, name, lastKnownVersion string, ...) (*edgeingress.EdgeIngress, error)
- func (c *Client) UpdateGateway(ctx context.Context, name, lastKnownVersion string, ...) (*api.Gateway, error)
- func (c *Client) UpdatePortal(ctx context.Context, name, lastKnownVersion string, updateReq *UpdatePortalReq) (*api.Portal, error)
- type Command
- type CommandExecutionReport
- type CommandExecutionReportError
- type CommandExecutionStatus
- type Config
- type ConfigWatcher
- type CreateAPIReq
- type CreateAccessReq
- type CreateCollectionReq
- type CreateEdgeIngressReq
- type CreateGatewayReq
- type CreatePortalReq
- type DomainCache
- type MetricsConfig
- type OpenAPISpec
- type Service
- type UpdateAPIReq
- type UpdateAccessReq
- type UpdateCollectionReq
- type UpdateEdgeIngressReq
- type UpdateGatewayReq
- type UpdatePortalReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACP ¶
type ACP struct {
Name string `json:"name"`
}
ACP defines the ACP attached to the edge ingress.
type APIService ¶ added in v1.2.0
type APIService struct { Name string `json:"name"` Port int `json:"port"` OpenAPISpec OpenAPISpec `json:"openApiSpec"` }
APIService is a service used in API struct.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows interacting with the cluster service.
func (*Client) CreateACP ¶
func (c *Client) CreateACP(ctx context.Context, policy *hubv1alpha1.AccessControlPolicy) (*acp.ACP, error)
CreateACP creates an AccessControlPolicy.
func (*Client) CreateAccess ¶ added in v1.2.0
CreateAccess creates an API access.
func (*Client) CreateCollection ¶ added in v1.2.0
func (c *Client) CreateCollection(ctx context.Context, createReq *CreateCollectionReq) (*api.Collection, error)
CreateCollection creates a collection.
func (*Client) CreateEdgeIngress ¶
func (c *Client) CreateEdgeIngress(ctx context.Context, createReq *CreateEdgeIngressReq) (*edgeingress.EdgeIngress, error)
CreateEdgeIngress creates an edge ingress.
func (*Client) CreateGateway ¶ added in v1.2.0
func (c *Client) CreateGateway(ctx context.Context, createReq *CreateGatewayReq) (*api.Gateway, error)
CreateGateway creates a gateway.
func (*Client) CreatePortal ¶ added in v1.2.0
CreatePortal creates a portal.
func (*Client) DeleteAccess ¶ added in v1.2.0
DeleteAccess deletes an API access.
func (*Client) DeleteCollection ¶ added in v1.2.0
DeleteCollection deletes a collection.
func (*Client) DeleteEdgeIngress ¶
func (c *Client) DeleteEdgeIngress(ctx context.Context, namespace, name, lastKnownVersion string) error
DeleteEdgeIngress deletes an edge ingress.
func (*Client) DeleteGateway ¶ added in v1.2.0
DeleteGateway deletes a gateway.
func (*Client) DeletePortal ¶ added in v1.2.0
DeletePortal deletes a portal.
func (*Client) FetchTopology ¶ added in v0.5.0
func (c *Client) FetchTopology(ctx context.Context) (topology state.Cluster, topoVersion int64, err error)
FetchTopology fetches the topology.
func (*Client) GetAccesses ¶ added in v1.2.0
GetAccesses fetches the accesses available for this agent.
func (*Client) GetCertificateByDomains ¶ added in v0.5.0
func (c *Client) GetCertificateByDomains(ctx context.Context, domains []string) (edgeingress.Certificate, error)
GetCertificateByDomains gets a certificate for the given domains.
func (*Client) GetCollections ¶ added in v1.2.0
GetCollections fetches the collections available for this agent.
func (*Client) GetEdgeIngresses ¶
func (c *Client) GetEdgeIngresses(ctx context.Context) ([]edgeingress.EdgeIngress, error)
GetEdgeIngresses returns the EdgeIngresses related to the agent.
func (*Client) GetGateways ¶ added in v1.2.0
GetGateways fetches the gateways available for this agent.
func (*Client) GetPortals ¶ added in v1.2.0
GetPortals fetches the portals available for this agent.
func (*Client) GetWildcardCertificate ¶ added in v0.5.0
func (c *Client) GetWildcardCertificate(ctx context.Context) (edgeingress.Certificate, error)
GetWildcardCertificate gets a certificate for the workspace.
func (*Client) ListPendingCommands ¶ added in v0.6.0
ListPendingCommands fetches the commands to apply on the cluster.
func (*Client) ListVerifiedDomains ¶
ListVerifiedDomains list verified domains.
func (*Client) PatchTopology ¶ added in v0.5.0
func (c *Client) PatchTopology(ctx context.Context, patch []byte, lastKnownVersion int64) (int64, error)
PatchTopology submits a JSON Merge Patch to the platform containing the difference in the topology since its last synchronization. The last known topology version must be provided. This version can be obtained by calling the FetchTopology method.
func (*Client) SetVersionStatus ¶ added in v0.6.0
SetVersionStatus sends the current version status to the platform.
func (*Client) SubmitCommandReports ¶ added in v0.6.0
func (c *Client) SubmitCommandReports(ctx context.Context, reports []CommandExecutionReport) error
SubmitCommandReports submits the given command execution reports.
func (*Client) UpdateACP ¶
func (c *Client) UpdateACP(ctx context.Context, oldVersion string, policy *hubv1alpha1.AccessControlPolicy) (*acp.ACP, error)
UpdateACP updates an AccessControlPolicy.
func (*Client) UpdateAPI ¶ added in v1.2.0
func (c *Client) UpdateAPI(ctx context.Context, namespace, name, lastKnownVersion string, updateReq *UpdateAPIReq) (*api.API, error)
UpdateAPI updates an API.
func (*Client) UpdateAccess ¶ added in v1.2.0
func (c *Client) UpdateAccess(ctx context.Context, name, lastKnownVersion string, updateReq *UpdateAccessReq) (*api.Access, error)
UpdateAccess updates an API access.
func (*Client) UpdateCollection ¶ added in v1.2.0
func (c *Client) UpdateCollection(ctx context.Context, name, lastKnownVersion string, updateReq *UpdateCollectionReq) (*api.Collection, error)
UpdateCollection updates a collection.
func (*Client) UpdateEdgeIngress ¶
func (c *Client) UpdateEdgeIngress(ctx context.Context, namespace, name, lastKnownVersion string, updateReq *UpdateEdgeIngressReq) (*edgeingress.EdgeIngress, error)
UpdateEdgeIngress updated an edge ingress.
func (*Client) UpdateGateway ¶ added in v1.2.0
func (c *Client) UpdateGateway(ctx context.Context, name, lastKnownVersion string, updateReq *UpdateGatewayReq) (*api.Gateway, error)
UpdateGateway updates a gateway.
func (*Client) UpdatePortal ¶ added in v1.2.0
func (c *Client) UpdatePortal(ctx context.Context, name, lastKnownVersion string, updateReq *UpdatePortalReq) (*api.Portal, error)
UpdatePortal updates a portal.
type Command ¶ added in v0.6.0
type Command struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` Type string `json:"type"` Data json.RawMessage `json:"data"` }
Command defines patch operation to apply on the cluster.
type CommandExecutionReport ¶ added in v0.6.0
type CommandExecutionReport struct { ID string `json:"id"` Status CommandExecutionStatus `json:"status"` Error *CommandExecutionReportError `json:"error,omitempty"` }
CommandExecutionReport describes the output of a command execution.
func NewErrorCommandExecutionReport ¶ added in v0.6.0
func NewErrorCommandExecutionReport(id string, err CommandExecutionReportError) *CommandExecutionReport
NewErrorCommandExecutionReport creates a new CommandExecutionReport with a status CommandExecutionStatusFailure.
func NewSuccessCommandExecutionReport ¶ added in v0.6.0
func NewSuccessCommandExecutionReport(id string) *CommandExecutionReport
NewSuccessCommandExecutionReport creates a new CommandExecutionReport with a status CommandExecutionStatusSuccess.
type CommandExecutionReportError ¶ added in v0.6.0
type CommandExecutionReportError struct { // Type identifies the reason of the error. Type string `json:"type"` // Data is a freeform Type dependent value. Data interface{} `json:"data,omitempty"` }
CommandExecutionReportError holds details about an execution failure.
type CommandExecutionStatus ¶ added in v0.6.0
type CommandExecutionStatus string
CommandExecutionStatus describes the execution status of a command.
const ( CommandExecutionStatusSuccess CommandExecutionStatus = "success" CommandExecutionStatusFailure CommandExecutionStatus = "failure" )
The different CommandExecutionStatus available.
type Config ¶
type Config struct { Metrics MetricsConfig `json:"metrics"` Features []string `json:"features"` }
Config holds the configuration of the offer.
type ConfigWatcher ¶
type ConfigWatcher struct {
// contains filtered or unexported fields
}
ConfigWatcher watches hub agent configuration.
func NewConfigWatcher ¶
func NewConfigWatcher(interval time.Duration, c *Client) *ConfigWatcher
NewConfigWatcher return a new ConfigWatcher.
func (*ConfigWatcher) AddListener ¶
func (w *ConfigWatcher) AddListener(listener func(cfg Config))
AddListener adds a listeners to the ConfigWatcher.
func (*ConfigWatcher) Run ¶
func (w *ConfigWatcher) Run(ctx context.Context)
Run runs ConfigWatcher.
type CreateAPIReq ¶ added in v1.2.0
type CreateAPIReq struct { Name string `json:"name"` Namespace string `json:"namespace"` Labels map[string]string `json:"labels,omitempty"` PathPrefix string `json:"pathPrefix"` Service APIService `json:"service"` }
CreateAPIReq is the request for creating an API.
type CreateAccessReq ¶ added in v1.2.0
type CreateAccessReq struct { Name string `json:"name"` Labels map[string]string `json:"labels,omitempty"` Groups []string `json:"groups"` APISelector *metav1.LabelSelector `json:"apiSelector,omitempty"` APICollectionSelector *metav1.LabelSelector `json:"apiCollectionSelector,omitempty"` }
CreateAccessReq is the request for creating an API access.
type CreateCollectionReq ¶ added in v1.2.0
type CreateCollectionReq struct { Name string `json:"name"` Labels map[string]string `json:"labels,omitempty"` PathPrefix string `json:"pathPrefix,omitempty"` APISelector metav1.LabelSelector `json:"apiSelector,omitempty"` }
CreateCollectionReq is the request for creating a collection.
type CreateEdgeIngressReq ¶
type CreateEdgeIngressReq struct { Name string `json:"name"` Namespace string `json:"namespace"` Service Service `json:"service"` ACP *ACP `json:"acp,omitempty"` CustomDomains []string `json:"customDomains,omitempty"` }
CreateEdgeIngressReq is the request for creating an edge ingress.
type CreateGatewayReq ¶ added in v1.2.0
type CreateGatewayReq struct { Name string `json:"name"` Labels map[string]string `json:"labels"` Accesses []string `json:"accesses"` CustomDomains []string `json:"customDomains"` }
CreateGatewayReq is the request for creating a gateway.
type CreatePortalReq ¶ added in v1.2.0
type CreatePortalReq struct { Name string `json:"name"` Title string `json:"title"` Description string `json:"description"` Gateway string `json:"gateway"` CustomDomains []string `json:"customDomains"` }
CreatePortalReq is the request for creating a portal.
type DomainCache ¶
type DomainCache struct {
// contains filtered or unexported fields
}
DomainCache caches the verified domains. It polls the domains from the platform at a given interval.
func NewDomainCache ¶
func NewDomainCache(client *Client, ttl time.Duration) *DomainCache
NewDomainCache creates a new domain cache configured with a platform client and a polling interval.
func (*DomainCache) ListVerifiedDomains ¶
func (d *DomainCache) ListVerifiedDomains(_ context.Context) []string
ListVerifiedDomains implements the validationwebhook.DomainLister interface.
func (*DomainCache) Run ¶
func (d *DomainCache) Run(ctx context.Context)
Run starts polling the platform to refresh the cache. NOTE: The call is synchronous and could be start in a goroutine.
type MetricsConfig ¶
type MetricsConfig struct { Interval time.Duration `json:"interval"` Tables []string `json:"tables"` }
MetricsConfig holds the metrics part of the offer config.
type OpenAPISpec ¶ added in v1.2.0
type OpenAPISpec struct { URL string `json:"url,omitempty"` Path string `json:"path,omitempty"` Port int `json:"port,omitempty"` }
OpenAPISpec is an OpenAPISpec. It can either be fetched from a URL, or Path/Port from the service.
type UpdateAPIReq ¶ added in v1.2.0
type UpdateAPIReq struct { Labels map[string]string `json:"labels,omitempty"` PathPrefix string `json:"pathPrefix"` Service APIService `json:"service"` }
UpdateAPIReq is a request for updating an API.
type UpdateAccessReq ¶ added in v1.2.0
type UpdateAccessReq struct { Labels map[string]string `json:"labels,omitempty"` Groups []string `json:"groups"` APISelector *metav1.LabelSelector `json:"apiSelector,omitempty"` APICollectionSelector *metav1.LabelSelector `json:"apiCollectionSelector,omitempty"` }
UpdateAccessReq is a request for updating an API access.
type UpdateCollectionReq ¶ added in v1.2.0
type UpdateCollectionReq struct { Labels map[string]string `json:"labels,omitempty"` PathPrefix string `json:"pathPrefix,omitempty"` APISelector metav1.LabelSelector `json:"apiSelector,omitempty"` }
UpdateCollectionReq is a request for updating a collection.
type UpdateEdgeIngressReq ¶
type UpdateEdgeIngressReq struct { Service Service `json:"service"` ACP *ACP `json:"acp,omitempty"` CustomDomains []string `json:"customDomains,omitempty"` }
UpdateEdgeIngressReq is a request for updating an edge ingress.
type UpdateGatewayReq ¶ added in v1.2.0
type UpdateGatewayReq struct { Labels map[string]string `json:"labels"` Accesses []string `json:"accesses"` CustomDomains []string `json:"customDomains"` }
UpdateGatewayReq is a request for updating a gateway.
type UpdatePortalReq ¶ added in v1.2.0
type UpdatePortalReq struct { Title string `json:"title"` Description string `json:"description"` Gateway string `json:"gateway"` HubDomain string `json:"hubDomain"` CustomDomains []string `json:"customDomains"` }
UpdatePortalReq is a request for updating a portal.