Documentation
¶
Index ¶
- Variables
- func DeletePlugins(client k8s.Interface, pluginID string) error
- func GetStatusAndHealthyInPodList(podList DaprPodList) (status string, healthy string)
- func GetTKeelNameSpace(client k8s.Interface) (string, error)
- func Init(config InitConfiguration) (err error)
- func InstallPlugin(config InitConfiguration, releaseName, pluginRepo, pluginName, version string) error
- func Invoke(pluginID, method string, data []byte, verb string) (string, error)
- func Register(pluginID string) error
- func RegisterPlugins(client k8s.Interface, pluginID string) error
- func Remove(pluginID string) error
- func Uninstall(namespace string, timeout uint, debugMode bool) error
- type App
- type DaprPod
- type DaprPodList
- type InitConfiguration
- type ListOutput
- type Plugin
- type PluginResponse
- type StatusClient
- type StatusOutput
- type TenantCreateResp
- type TenantCreateResponse
- type TenantListData
- type TenantListResponse
- type User
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Client = dapr.Client
View Source
var ErrDaprNotInstall = errors.New("dapr is not installed in your cluster")
Functions ¶
func DeletePlugins ¶
DeletePlugins curl -XDELETE "http://192.168.123.11:30777/v1/plugins/keel-echo"
func GetStatusAndHealthyInPodList ¶ added in v0.2.0
func GetStatusAndHealthyInPodList(podList DaprPodList) (status string, healthy string)
GetStatusAndHealthyInPodList loop through all replicas and update to Running/Healthy status only if all instances are Running and Healthy.
func Init ¶
func Init(config InitConfiguration) (err error)
Init deploys the tKeel operator using the supplied runtime version.
func InstallPlugin ¶ added in v0.2.0
func InstallPlugin(config InitConfiguration, releaseName, pluginRepo, pluginName, version string) error
InstallPlugin deploys the tKeel plugin.
Types ¶
type App ¶ added in v0.2.0
type App struct {
AppID string `csv:"APP ID" json:"appId" yaml:"appId"`
AppPort string `csv:"APP PORT" json:"appPort" yaml:"appPort"`
PodName string `csv:"POD NAME" json:"podName" yaml:"podName"`
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 DaprPodList ¶ added in v0.2.0
type DaprPodList []DaprPod
func ListPluginPods ¶ added in v0.2.0
func ListPluginPods(client k8s.Interface, appIDs ...string) (DaprPodList, error)
List outputs plugins.
Example ¶
client, err := Client()
if err != nil {
fmt.Println(err)
}
{
ret, err := ListPluginPods(client)
if err != nil {
panic(err)
}
fmt.Println("pods:", len(ret))
ret, err = ListPluginPods(client, "rudder")
if err != nil {
panic(err)
}
fmt.Println("pods:", len(ret))
for _, p := range ret {
app := p.App()
if app.AppID == "rudder" {
res := app.Request(client.CoreV1().RESTClient().Get()).Suffix("v1/plugins")
ret := res.Do(context.TODO())
raw, err := ret.Raw()
fmt.Println(string(raw), err)
}
}
}
Output: pods: 4 pods: 1 {"pluginList":[{"id":"keel-echo","tkeel_version":"v0.2.0","secret":"changeme","register_timestamp":1637909273}]} <nil>
func (DaprPodList) GroupByAppID ¶ added in v0.2.0
func (l DaprPodList) GroupByAppID() map[string]DaprPodList
type InitConfiguration ¶
type ListOutput ¶
type ListOutput struct {
AppID string `csv:"APP ID"`
AppPort string `csv:"APP PORT"`
Age string `csv:"AGE"`
Created string `csv:"CREATED"`
Status string `json:"status"`
}
ListOutput represents the application ID, application port and creation time.
type Plugin ¶
type PluginResponse ¶
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 TenantCreateResp ¶
type TenantCreateResp struct {
TenantID string `json:"tenant_id"`
Title string `json:"title"`
CreatedTime int64 `json:"created_time"`
TenantAdmin User `json:"tenant_admin"`
}
func CreateTenant ¶
func CreateTenant(client k8s.Interface, namespace, tenantTitle string) (*TenantCreateResp, error)
func TenantCreate ¶
func TenantCreate(tenantTitle string) (*TenantCreateResp, error)
type TenantCreateResponse ¶
type TenantCreateResponse struct {
Ret int `json:"ret"`
Msg string `json:"msg"`
Data TenantCreateResp `json:"data"`
}
type TenantListData ¶
type TenantListData struct {
TenantList []TenantCreateResp `json:"tenant_list"`
}
func ListTenant ¶
func ListTenant(client k8s.Interface, namespace string) (*TenantListData, error)
func TenantList ¶
func TenantList() (*TenantListData, error)
type TenantListResponse ¶
type TenantListResponse struct {
Ret int `json:"ret"`
Msg string `json:"msg"`
Data TenantListData `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.