Documentation
¶
Index ¶
- func HashAPI(a *hubv1alpha1.API) (string, error)
- func HashAccess(a *hubv1alpha1.APIAccess) (string, error)
- func HashCollection(c *hubv1alpha1.APICollection) (string, error)
- func HashGateway(g *hubv1alpha1.APIGateway) (string, error)
- func HashPortal(p *hubv1alpha1.APIPortal) (string, error)
- type API
- type Access
- type Collection
- type CustomDomain
- type Gateway
- type OpenAPISpec
- type PlatformClient
- type Portal
- type Service
- type WatcherAPI
- type WatcherAccess
- type WatcherCollection
- type WatcherGateway
- type WatcherGatewayConfig
- type WatcherPortal
- type WatcherPortalConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashAPI ¶
func HashAPI(a *hubv1alpha1.API) (string, error)
HashAPI generates the hash of the API.
func HashAccess ¶
func HashAccess(a *hubv1alpha1.APIAccess) (string, error)
HashAccess generates the hash of the APIAccess.
func HashCollection ¶
func HashCollection(c *hubv1alpha1.APICollection) (string, error)
HashCollection generates the hash of the APICollection.
func HashGateway ¶
func HashGateway(g *hubv1alpha1.APIGateway) (string, error)
HashGateway generates the hash of the APIGateway.
func HashPortal ¶
func HashPortal(p *hubv1alpha1.APIPortal) (string, error)
HashPortal generates the hash of the APIPortal.
Types ¶
type API ¶
type API struct { Name string `json:"name"` Namespace string `json:"namespace"` Labels map[string]string `json:"labels,omitempty"` PathPrefix string `json:"pathPrefix"` Service Service `json:"service"` Version string `json:"version"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
API is an API exposed within a portal.
type Access ¶
type Access 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"` Version string `json:"version"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
Access defines who can access APIs.
type Collection ¶
type Collection struct { Name string `json:"name"` Labels map[string]string `json:"labels,omitempty"` PathPrefix string `json:"pathPrefix,omitempty"` APISelector metav1.LabelSelector `json:"apiSelector"` Version string `json:"version"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
Collection is a collection of APIs exposed within an APIPortal.
func (*Collection) Resource ¶
func (c *Collection) Resource() (*hubv1alpha1.APICollection, error)
Resource builds the v1alpha1 Collection resource.
type CustomDomain ¶
CustomDomain holds domain information.
type Gateway ¶
type Gateway struct { WorkspaceID string `json:"workspaceId"` ClusterID string `json:"clusterId"` Name string `json:"name"` Labels map[string]string `json:"labels,omitempty"` Accesses []string `json:"accesses,omitempty"` Version string `json:"version"` HubDomain string `json:"hubDomain,omitempty"` CustomDomains []CustomDomain `json:"customDomains,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
Gateway is a gateway that exposes a set of APIs.
func (*Gateway) Resource ¶
func (g *Gateway) Resource() (*hubv1alpha1.APIGateway, error)
Resource builds the v1alpha1 APIGateway resource.
type OpenAPISpec ¶
type OpenAPISpec struct { URL string `json:"url,omitempty" bson:"url,omitempty"` Path string `json:"path,omitempty" bson:"path,omitempty"` Port int `json:"port,omitempty" bson:"port,omitempty"` }
OpenAPISpec is an OpenAPISpec. It can either be fetched from a URL, or Path/Port from the service or directly in the Schema field.
type PlatformClient ¶
type PlatformClient interface { GetPortals(ctx context.Context) ([]Portal, error) GetWildcardCertificate(ctx context.Context) (edgeingress.Certificate, error) GetCertificateByDomains(ctx context.Context, domains []string) (edgeingress.Certificate, error) GetGateways(ctx context.Context) ([]Gateway, error) GetAPIs(ctx context.Context) ([]API, error) GetCollections(ctx context.Context) ([]Collection, error) GetAccesses(ctx context.Context) ([]Access, error) }
PlatformClient for the API service.
type Portal ¶
type Portal struct { WorkspaceID string `json:"workspaceId"` ClusterID string `json:"clusterId"` Name string `json:"name"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Gateway string `json:"gateway"` HubDomain string `json:"hubDomain,omitempty"` CustomDomains []CustomDomain `json:"customDomains,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Version string `json:"version"` }
Portal is a WebUI that exposes a set of OpenAPI specs.
type Service ¶
type Service struct { Name string `json:"name" bson:"name"` Port int `json:"port" bson:"port"` OpenAPISpec OpenAPISpec `json:"openApiSpec,omitempty" bson:"openApiSpec,omitempty"` }
Service is a Kubernetes Service.
type WatcherAPI ¶
type WatcherAPI struct {
// contains filtered or unexported fields
}
WatcherAPI watches hub APIs and sync them with the cluster.
func NewWatcherAPI ¶
func NewWatcherAPI(client PlatformClient, hubClientSet hubclientset.Interface, hubInformer hubinformer.SharedInformerFactory, apiSyncInterval time.Duration) *WatcherAPI
NewWatcherAPI returns a new WatcherAPI.
type WatcherAccess ¶
type WatcherAccess struct {
// contains filtered or unexported fields
}
WatcherAccess watches hub API accesses and sync them with the cluster.
func NewWatcherAccess ¶
func NewWatcherAccess(client PlatformClient, hubClientSet hubclientset.Interface, hubInformer hubinformer.SharedInformerFactory, accessSyncInterval time.Duration) *WatcherAccess
NewWatcherAccess returns a new WatcherAccess.
func (*WatcherAccess) Run ¶
func (w *WatcherAccess) Run(ctx context.Context)
Run runs WatcherAccess.
type WatcherCollection ¶
type WatcherCollection struct {
// contains filtered or unexported fields
}
WatcherCollection watches hub APICollections and sync them with the cluster.
func NewWatcherCollection ¶
func NewWatcherCollection(client PlatformClient, hubClientSet hubclientset.Interface, hubInformer hubinformer.SharedInformerFactory, collectionSyncInterval time.Duration) *WatcherCollection
NewWatcherCollection returns a new WatcherCollection.
func (*WatcherCollection) Run ¶
func (w *WatcherCollection) Run(ctx context.Context)
Run runs WatcherCollection.
type WatcherGateway ¶
type WatcherGateway struct {
// contains filtered or unexported fields
}
WatcherGateway watches hub gateways and sync them with the cluster.
func NewWatcherGateway ¶
func NewWatcherGateway(client PlatformClient, kubeClientSet clientset.Interface, kubeInformer informers.SharedInformerFactory, hubClientSet hubclientset.Interface, hubInformer hubinformer.SharedInformerFactory, traefikClientSet v1alpha1.TraefikV1alpha1Interface, config *WatcherGatewayConfig) *WatcherGateway
NewWatcherGateway returns a new WatcherGateway.
func (*WatcherGateway) Run ¶
func (w *WatcherGateway) Run(ctx context.Context)
Run runs WatcherGateway.
type WatcherGatewayConfig ¶
type WatcherGatewayConfig struct { IngressClassName string AgentNamespace string TraefikAPIEntryPoint string TraefikTunnelEntryPoint string GatewaySyncInterval time.Duration CertSyncInterval time.Duration CertRetryInterval time.Duration }
WatcherGatewayConfig holds the watcher gateway configuration.
type WatcherPortal ¶
type WatcherPortal struct {
// contains filtered or unexported fields
}
WatcherPortal watches hub portals and sync them with the cluster.
func NewWatcherPortal ¶
func NewWatcherPortal(client PlatformClient, kubeClientSet clientset.Interface, kubeInformer informers.SharedInformerFactory, hubClientSet hubclientset.Interface, hubInformer hubinformer.SharedInformerFactory, config *WatcherPortalConfig) *WatcherPortal
NewWatcherPortal returns a new WatcherPortal.
func (*WatcherPortal) Run ¶
func (w *WatcherPortal) Run(ctx context.Context)
Run runs WatcherPortal.
type WatcherPortalConfig ¶
type WatcherPortalConfig struct { IngressClassName string AgentNamespace string TraefikAPIEntryPoint string TraefikTunnelEntryPoint string DevPortalServiceName string DevPortalPort int PortalSyncInterval time.Duration CertSyncInterval time.Duration CertRetryInterval time.Duration }
WatcherPortalConfig holds the portal watcher configuration.