Documentation ¶
Index ¶
- Variables
- type AuthType
- type BackendType
- type BasicAuth
- type BuildInfo
- type Class
- type Header
- type Includes
- type Info
- type InfoLink
- type JSONData
- type JWTTokenAuth
- type KubernetesSecret
- type KubernetesService
- type Logos
- type Permission
- type Plugin
- type PluginSource
- type Requirement
- type Route
- type Screenshots
- type StaticRoute
- type Type
- type Workspace
Constants ¶
This section is empty.
Variables ¶
var PluginTypes = []Type{ PageApp, Definition, }
PluginTypes plugin type definition
Functions ¶
This section is empty.
Types ¶
type AuthType ¶
type AuthType string
AuthType The authentication type of the backend server
var ( // Basic Authentication is a method to provide a username and password when making a request. Basic AuthType = "basic" )
type BackendType ¶
type BackendType string
BackendType the backend server type
var ( // KubeAPI Proxy the Kubernetes API. // this plugin need to define the permission of Kubernetes RBAC. // When installing the plugin, Vela will create a Role and use this role to request the Kubernetes API. KubeAPI BackendType = "kube-api" // KubeService Discover the backend by the Kubernetes service. KubeService BackendType = "kube-service" // StaticServer Discover the backend by the plugin setting StaticServer BackendType = "static-server" )
type BuildInfo ¶
type BuildInfo struct { Time int64 `json:"time,omitempty"` Repo string `json:"repo,omitempty"` Branch string `json:"branch,omitempty"` Hash string `json:"hash,omitempty"` }
BuildInfo the plugin build info
type Header ¶
Header describes an HTTP header that is forwarded with the proxied request for a plugin route
type Includes ¶
type Includes struct { Name string `json:"name"` Label string `json:"label"` To string `json:"to"` Type string `json:"type"` Icon string `json:"icon"` Workspace Workspace `json:"workspace"` Permission *Permission `json:"permission,omitempty"` RelatedRoute []string `json:"relatedRoute"` Catalog string `json:"catalog,omitempty"` }
Includes means the menus that this plugin include.
type Info ¶
type Info struct { Author InfoLink `json:"author"` Description string `json:"description"` Links []InfoLink `json:"links"` Logos Logos `json:"logos"` Build BuildInfo `json:"build"` Screenshots []Screenshots `json:"screenshots"` Version string `json:"version"` Updated string `json:"updated"` }
Info the info model
type JSONData ¶
type JSONData struct { ID string `json:"id"` Type Type `json:"type"` // there are four sub types in the definition plugin type, includes: component, trait, policy ,and workflow-step. SubType string `json:"subType"` Name string `json:"name"` Info Info `json:"info"` Includes []*Includes `json:"includes"` Category string `json:"category"` // Backend If the plugin has a backend component. Backend bool `json:"backend"` Proxy bool `json:"proxy"` BackendType BackendType `json:"backendType"` AuthType AuthType `json:"authType,omitempty"` AuthSecret *KubernetesSecret `json:"authSecret,omitempty"` // For the kube auth type, define the max scope permission for this plugin. KubePermissions []rbacv1.PolicyRule `json:"kubePermissions,omitempty"` // For the KubeService backend type BackendService *KubernetesService `json:"backendService"` // Routes define the route to proxy the backend server. Routes []*Route `json:"routes,omitempty"` Requirement *Requirement `json:"requirement,omitempty"` }
JSONData represents the plugin's plugin.json
type JWTTokenAuth ¶
type JWTTokenAuth struct { URL string `json:"url"` Scopes []string `json:"scopes"` Params map[string]string `json:"params"` }
JWTTokenAuth struct is both for normal Token Auth and JWT Token Auth with an uploaded JWT file.
type KubernetesSecret ¶
type KubernetesSecret struct { Name string `json:"name"` // If namespace is not specified, find the service from the vela system namespace Namespace string `json:"namespace"` }
KubernetesSecret define one kubernetes secret
type KubernetesService ¶
type KubernetesService struct { Name string `json:"name"` // If namespace is not specified, find the service from the vela system namespace Namespace string `json:"namespace"` // If port is not specified, find the first port from the service Port int32 }
KubernetesService define one kubernetes service
type Permission ¶
Permission RBAC permission policy
type Plugin ¶
type Plugin struct { JSONData PluginDir string Class Class // SystemJS fields Module string BaseURL string }
Plugin VelaUX plugin model
func (*Plugin) IsCorePlugin ¶
IsCorePlugin checking the plugin whether is the core plugin
func (*Plugin) IsExternalPlugin ¶
IsExternalPlugin checking the plugin whether is the external plugin
func (*Plugin) StaticRoute ¶
func (p *Plugin) StaticRoute() *StaticRoute
StaticRoute generate the plugin static file route
type PluginSource ¶
PluginSource the plugin source.
type Requirement ¶
type Requirement struct {
VelaUXVersion string `json:"velauxVersion"`
}
Requirement the plugin requirement
type Route ¶
type Route struct { // Route conditions. // Path format like: /nodes/:nodeName Path string `json:"path"` Method string `json:"method"` // Permission checking ResourceMap map[string]string `json:"resourceMap,omitempty"` Permission *Permission `json:"permission,omitempty"` // Proxy parameters ProxyHeaders []Header `json:"headers,omitempty"` }
Route describes a plugin route that is defined in the plugin.json file for a plugin.
type Screenshots ¶
Screenshots the screenshot model