Documentation ¶
Index ¶
- Constants
- Variables
- func AddRepo(name, url string) error
- func AdminLogin(password string) (token string, err error)
- func CleanInvalidTenants(pluginID string, tenants []string, namespace string) error
- func CleanToken()
- func CoreApply(filenames []string) error
- func CoreCreate(filenames []string) error
- func CoreGet(entityID string) error
- func CoreList(search, selector string) error
- func CoreWatch(entityID string) error
- func CreateTenant(tenant *TenantCreateIn) error
- func DeleteRepo(name string) error
- func DisablePlugin(pluginID, tenantID string) error
- func EnablePlugin(pluginID, tenantID string) error
- func GetConfig(client k8s.Interface, name, namespace string) (*corev1.ConfigMap, error)
- func GetRedisPassword(namespace string) (string, error)
- func GetStatusAndHealthyInPodList(appList DaprAppList) (status string, healthy string)
- func GetTKeelNamespace(client k8s.Interface) (string, error)
- func GroupByAppID(l DaprAppList) map[string]DaprAppList
- func Init(config InitConfiguration) error
- func InitHelmConfig(namespace string, log action.DebugLog) (*action.Configuration, error)
- func InjectConfig(root *chart.Chart, name, secret string) error
- func Install(repo, plugin, version, name string, config []byte) error
- func Invoke(pluginID, method string, data []byte, verb string, ...) (string, error)
- func InvokeByPortForward(pluginID, method string, data []byte, verb string, ...) (string, error)
- func PluginUpgrade(repo, plugin, version, name string, config []byte) error
- func RegisterPlugin(plugin string) error
- func RegisterPlugins(client k8s.Interface, pluginID string) error
- func TenantCreate(title, remark, adminName, adminPW string) error
- func TenantDelete(tenantID string) error
- func TenantUserCreate(tenantID, username, password string) error
- func TenantUserDelete(tenantID, userID string) error
- func UninstallAllPlugin() error
- func UninstallPlatform(namespace string, timeout uint, debugMode bool) error
- func UninstallPlugin(pluginID string) error
- func Upgrade(config InitConfiguration) error
- func WebsocketByPortForward(pluginID, method string, data []byte) (string, error)
- func WithAppPod(pf *PortForward, app *AppPod) error
- func WithAppPort(pf *PortForward, app *AppPod) error
- func WithHTTPPort(pf *PortForward, app *AppPod) error
- type AddRepoRequest
- type AppInfo
- type AppPod
- type AuthRequest
- type CoreStruct
- type DaprAppList
- type DaprPod
- type DaprStatus
- type DeleteResponse
- type EnablePluginRequest
- type EnableTenant
- type HTTPRequestOption
- type InitConfiguration
- type InstalledListOutput
- type InstallerListOutPut
- type ListResponse
- type MiddleConfig
- type Plugin
- type PluginEnableInfo
- type PortForward
- type PortForwardConfigureOption
- type RegisterAddons
- type RepoListOutput
- type RepoPluginListOutput
- type RestRequestOption
- type SearchCondition
- type SearchRequest
- type StatusClient
- type StatusOutput
- type TKeelStatus
- type TenantAdmin
- type TenantCreateIn
- type TenantListOutPut
- type UserInfo
- type UserListOutPut
Constants ¶
const ( PluginConfig = `` /* 748-byte string literal not displayed */ PluginOAuth2 = `` /* 775-byte string literal not displayed */ )
const ( Always = "Always" IfNotPresent = "IfNotPresent" )
Variables ¶
var Client = dapr.Client
var ErrDaprNotInstall = errors.New("dapr is not installed in your cluster")
var ErrTKeelNotInstall = errors.New("tkeel is not installed in your cluster")
Functions ¶
func AdminLogin ¶ added in v0.4.5
func CleanInvalidTenants ¶ added in v1.0.3
func CleanToken ¶ added in v0.4.5
func CleanToken()
func CoreCreate ¶ added in v0.4.5
func CreateTenant ¶
func CreateTenant(tenant *TenantCreateIn) error
func DeleteRepo ¶ added in v0.4.5
func DisablePlugin ¶ added in v0.4.5
func EnablePlugin ¶ added in v0.4.5
func GetRedisPassword ¶ added in v1.0.3
func GetStatusAndHealthyInPodList ¶ added in v0.2.0
func GetStatusAndHealthyInPodList(appList DaprAppList) (status string, healthy string)
GetStatusAndHealthyInPodList loop through all replicas and update to Running/Healthy status only if all instances are Running and Healthy.
func GetTKeelNamespace ¶ added in v0.4.5
func GroupByAppID ¶ added in v0.4.5
func GroupByAppID(l DaprAppList) map[string]DaprAppList
func Init ¶
func Init(config InitConfiguration) error
Init deploys the tKeel operator using the supplied runtime version.
func InitHelmConfig ¶ added in v0.4.7
func Invoke ¶ added in v0.2.0
func Invoke(pluginID, method string, data []byte, verb string, reqOpts ...RestRequestOption) (string, error)
Invoke is a command to invoke a remote or local dapr instance.
func InvokeByPortForward ¶ added in v0.4.5
func InvokeByPortForward(pluginID, method string, data []byte, verb string, reqOpts ...HTTPRequestOption) (string, error)
InvokeByPortForward is a command to invoke a remote or local dapr instance.
func PluginUpgrade ¶ added in v0.4.5
func RegisterPlugin ¶ added in v0.4.5
func TenantCreate ¶
func TenantDelete ¶ added in v0.4.5
func TenantUserCreate ¶ added in v0.4.5
func TenantUserDelete ¶ added in v0.4.5
tenant user manage.
func UninstallAllPlugin ¶ added in v0.4.5
func UninstallAllPlugin() error
func UninstallPlatform ¶ added in v0.4.5
UninstallPlatform removes tKeel from a Kubernetes cluster.
func UninstallPlugin ¶ added in v0.4.5
func Upgrade ¶ added in v0.4.5
func Upgrade(config InitConfiguration) error
func WebsocketByPortForward ¶ added in v0.4.5
WebsocketByPortForward websocket request to the k8s pod.
func WithAppPod ¶ added in v0.4.5
func WithAppPod(pf *PortForward, app *AppPod) error
func WithAppPort ¶ added in v0.4.5
func WithAppPort(pf *PortForward, app *AppPod) error
func WithHTTPPort ¶ added in v0.4.5
func WithHTTPPort(pf *PortForward, app *AppPod) error
Types ¶
type AddRepoRequest ¶ added in v0.4.5
type AddRepoRequest struct {
URL string `json:"url"`
}
type AppInfo ¶ added in v0.4.5
type AppInfo struct { AppID string `csv:"APP ID" json:"app_id" yaml:"app_id"` HTTPPort int `csv:"HTTP PORT" json:"http_port" yaml:"http_port"` GRPCPort int `csv:"GRPC PORT" json:"grpc_port" yaml:"grpc_port"` AppPort int `csv:"APP PORT" json:"app_port" yaml:"app_port"` PodName string `csv:"POD NAME" json:"pod_name" yaml:"pod_name"` Namespace string `csv:"NAMESPACE" json:"namespace" yaml:"namespace"` Age string `csv:"AGE" json:"age" yaml:"age"` Created string `csv:"CREATED" json:"created" yaml:"created"` Version string `csv:"VERSION" json:"version" yaml:"version"` }
type AppPod ¶ added in v0.2.0
type AppPod struct { AppInfo // contains filtered or unexported fields }
type AuthRequest ¶ added in v0.4.5
type CoreStruct ¶ added in v0.4.5
type DaprAppList ¶ added in v0.4.5
type DaprAppList []*AppPod
func ListAppInfos ¶ added in v0.4.5
func ListAppInfos(client k8s.Interface, appIDs ...string) (DaprAppList, error)
ListAppInfos ListPluginPods outputs plugins list.
type DaprStatus ¶ added in v0.4.5
type DaprStatus struct { Installed bool `json:"installed"` Version string `json:"version"` Namespace string `json:"namespace"` MTLSEnabled bool `json:"mtls_enabled"` }
func CheckDapr ¶ added in v0.6.0
func CheckDapr() (*DaprStatus, error)
type DeleteResponse ¶ added in v0.4.5
type DeleteResponse struct {
Plugin *Plugin `json:"plugin"`
}
type EnablePluginRequest ¶ added in v0.4.5
type EnablePluginRequest struct {
PluginID string `json:"plugin_id"`
}
type EnableTenant ¶ added in v1.0.3
type HTTPRequestOption ¶ added in v0.4.5
func InvokeSetHTTPHeader ¶ added in v0.4.5
func InvokeSetHTTPHeader(header, val string) HTTPRequestOption
type InitConfiguration ¶
type InitConfiguration struct { Version string KeelVersion string CoreVersion string RudderVersion string MiddlewareVersion string Namespace string Secret string EnableMTLS bool EnableHA bool DaprVersion string Args []string Wait bool Timeout uint DebugMode bool ConfigFile string Password string Repo *kitconfig.Repo DefaultConfig bool ImagePolicy string }
type InstalledListOutput ¶ added in v0.4.5
type InstalledListOutput struct { Name string `csv:"NAME"` Plugin string `csv:"PLUGIN"` PluginVersion string `csv:"PLUGIN VERSION"` Repo string `csv:"REPO"` RegisterAt string `csv:"REGISTER_AT"` Status string `csv:"STATE"` Description string `csv:"DESCRIPTION"` }
func InstalledPlugin ¶ added in v0.6.0
func InstalledPlugin() ([]InstalledListOutput, error)
func PluginInfo ¶ added in v0.4.5
func PluginInfo(pluginID string) ([]InstalledListOutput, error)
type InstallerListOutPut ¶ added in v0.4.5
type InstallerListOutPut struct { Name string `csv:"NAME"` Version string `csv:"VERSION"` Repo string `csv:"REPO"` Status string `csv:"STATUS"` }
func InstallerInfo ¶ added in v0.4.5
func InstallerInfo(repo, installer, version string) ([]InstallerListOutPut, error)
func InstallerList ¶ added in v0.4.5
func InstallerList(repo string) ([]InstallerListOutPut, error)
func InstallerListAll ¶ added in v0.4.5
func InstallerListAll() ([]InstallerListOutPut, error)
type ListResponse ¶ added in v0.4.5
type ListResponse struct {
PluginList []*Plugin `json:"plugin_list"`
}
type MiddleConfig ¶ added in v0.4.7
func ChartMiddleware ¶ added in v0.4.7
func ChartMiddleware(name, version string, config InitConfiguration) (*chart.Chart, MiddleConfig, error)
func (MiddleConfig) Update ¶ added in v0.4.7
func (mc MiddleConfig) Update(data MiddleConfig)
type Plugin ¶
type Plugin struct { ID string `json:"id,omitempty"` // plugin id. PluginVersion string `json:"plugin_version,omitempty"` // plugin version. TkeelVersion string `json:"tkeel_version,omitempty"` // plugin depend tkeel version. AddonsPoint []*v1.AddonsPoint `json:"addons_point,omitempty"` // plugin declares addons. ImplementedPlugin []*v1.ImplementedPlugin `json:"implemented_plugin,omitempty"` // plugin implemented plugin list. Secret string `json:"secret,omitempty"` // plugin registered secret. RegisterTimestamp int64 `json:"register_timestamp,omitempty"` // register timestamp. ActiveTenantes []string `json:"active_tenantes,omitempty"` // active tenant's id list. RegisterAddons []*RegisterAddons `json:"register_addons,omitempty"` // register addons router. Status v1.PluginStatus `json:"status,omitempty"` // register plugin status. }
func Unregister ¶ added in v0.4.5
func UnregisterPlugins ¶ added in v0.4.5
type PluginEnableInfo ¶ added in v1.0.3
type PluginEnableInfo struct { ID string `json:"id"` Installer struct { Repo string `json:"repo"` Name string `json:"name"` Version string `json:"version"` Desc string `json:"desc"` Maintainer []struct { Name string `json:"name"` URL string `json:"url"` Email string `json:"email"` } `json:"maintainer"` } `json:"installer"` TkeelVersion string `json:"tkeel_version"` Secret string `json:"secret"` RegisterTimestamp int `json:"register_timestamp"` Version string `json:"version"` Status int `json:"status"` EnableTenantes []EnableTenant `json:"enable_tenantes"` }
type PortForward ¶ added in v0.4.5
type PortForward struct { Config *rest.Config Method string URL *url.URL Host string LocalPort int RemotePort int EmitLogs bool App *AppPod StopCh chan struct{} ReadyCh chan struct{} }
PortForward provides a port-forward connection in a kubernetes cluster.
func GetPodPortForward ¶ added in v1.0.3
func GetPodPortForward(name, namespace string, port int) (*PortForward, error)
func GetPortforward ¶ added in v0.4.5
func GetPortforward(appName string, options ...PortForwardConfigureOption) (*PortForward, error)
func NewPortForward ¶ added in v0.4.5
func NewPortForward( config *rest.Config, namespace, podName string, host string, localPort, remotePort int, emitLogs bool, ) (*PortForward, error)
NewPortForward returns an instance of PortForward struct that can be used for establishing port-forwarding connection to a pod in kubernetes cluster, specified by namespace and deployName.
func (*PortForward) GetStop ¶ added in v0.4.5
func (pf *PortForward) GetStop() <-chan struct{}
GetStop returns StopCh for a PortForward instance. Receiving on StopCh will block until the port forwarding stops.
func (*PortForward) Init ¶ added in v0.4.5
func (pf *PortForward) Init() error
Init creates and runs a port-forward connection. This function blocks until connection is established. Note: Caller should call Stop() to finish the connection.
func (*PortForward) Stop ¶ added in v0.4.5
func (pf *PortForward) Stop()
Stop terminates port-forwarding connection.
type PortForwardConfigureOption ¶ added in v0.4.5
type PortForwardConfigureOption func(*PortForward, *AppPod) error
type RegisterAddons ¶ added in v0.4.5
type RepoListOutput ¶ added in v0.4.5
func ListRepo ¶ added in v0.4.5
func ListRepo() ([]RepoListOutput, error)
type RepoPluginListOutput ¶ added in v0.4.5
type RepoPluginListOutput struct { Name string `csv:"NAME"` Version string `csv:"VERSION"` Status string `csv:"STATUS"` Description string `csv:"DESCRIPTION"` }
func ListPluginsOfTenant ¶ added in v1.0.0
func ListPluginsOfTenant(tenant string) ([]RepoPluginListOutput, error)
type RestRequestOption ¶ added in v0.4.5
func InvokeSetRestRequestHeader ¶ added in v0.4.5
func InvokeSetRestRequestHeader(header string, val string) RestRequestOption
type SearchCondition ¶ added in v0.4.5
type SearchRequest ¶ added in v0.4.5
type SearchRequest struct { Query string `json:"query"` Condition []*SearchCondition `json:"condition"` }
type StatusClient ¶
type StatusClient struct {
// contains filtered or unexported fields
}
func NewStatusClient ¶
func NewStatusClient() (*StatusClient, error)
Create a new k8s client for status commands.
type StatusOutput ¶
type StatusOutput struct { Name string `csv:"NAME"` Namespace string `csv:"NAMESPACE"` Healthy string `csv:"HEALTHY"` Status string `csv:"STATUS"` PluginStatus string `csv:"PLUGINSTATUS"` Replicas int `csv:"REPLICAS"` Version string `csv:"VERSION"` Age string `csv:"AGE"` Created string `csv:"CREATED"` }
StatusOutput represents the status of a named tKeel resource.
func List ¶
func List() ([]StatusOutput, error)
type TKeelStatus ¶ added in v0.6.0
type TKeelStatus struct { Installed bool `json:"installed"` Version string `json:"version"` Namespace string `json:"namespace"` }
func CheckTKeel ¶ added in v0.6.0
func CheckTKeel() (*TKeelStatus, error)
type TenantAdmin ¶ added in v0.4.5
type TenantCreateIn ¶ added in v0.4.5
type TenantCreateIn struct { Title string `json:"title"` Remark string `json:"remark"` Admin TenantAdmin `json:"admin"` }
type TenantListOutPut ¶ added in v0.4.5
type TenantListOutPut struct { ID string `csv:"ID"` Title string `csv:"TITLE"` Remark string `csv:"REMARK"` }
func TenantInfo ¶ added in v0.4.5
func TenantInfo(tenantID string) ([]TenantListOutPut, error)
func TenantList ¶
func TenantList() ([]TenantListOutPut, error)
func TenantPluginList ¶ added in v0.6.0
func TenantPluginList(pluginID string) ([]TenantListOutPut, error)
type UserListOutPut ¶ added in v0.4.5
type UserListOutPut struct { ID string `csv:"ID"` Username string `csv:"USERNAME"` TenantID string `csv:"TENANT ID"` }
func TenantUserInfo ¶ added in v0.4.5
func TenantUserInfo(tenantID, userID string) ([]UserListOutPut, error)
func TenantUserList ¶ added in v0.4.5
func TenantUserList(tenantID string) ([]UserListOutPut, error)