Documentation
¶
Index ¶
- Constants
- type ActionType
- type AuditLog
- type ClusterDB
- type ClusterPluginDB
- type ConfigDB
- type ImageList
- type ImageTags
- type Info
- type InfoType
- type InspectDB
- type InspectInfoDB
- type LDAPDB
- type Metadata
- type NamespaceDB
- type PatchData
- type PatchJson
- type PlatformRoleDB
- type PluginDB
- type PostType
- type PostYaml
- type ProductDB
- type Projects
- type ResponseData
- type TemplateDB
- type User
Constants ¶
View Source
const ( KingfisherPath = "/kingfisher/api/v1.10/" K8SPath = "/kubernetes/api/v1.10/" Istio = "/istio/api/v1.10/" InspectPath = "/inspect/api/v1.10/" PresetPath = "/preset/api/v1.10/" REGISTRYURL = "registry.kingfisher.com/kingfisher/" KubeConfigPath = "/etc/" Signing = "kingfisher" ExpiresAt = 30 * 24 * time.Hour KingfisherURL = "http://192.168.10.11:30090/kubernetes/api/v1.10/token" KingfisherOut = "http://192.168.10.11:30090/login" Kingfisher = "http://192.168.10.11:30090/home" KingfisherDomain = "" HeaderSigning = "X-Signing" // k8s各种服务资源 Namespace = "namespace" Node = "node" Service = "service" Pod = "pod" Image = "image" Deployment = "deployment" StatefulSet = "stateful_set" DaemonSet = "daemon_set" Secret = "secret" ConfigMap = "config_map" Ingress = "ingress" Role = "Role" Endpoint = "endpoint" ClusterRole = "cluster_role" RoleBinding = "role_binding" ClusterRoleBinding = "cluster_role_binding" HPA = "hpa" Cluster = "cluster" PVC = "pvc" PV = "pv" SC = "storage_classes" ServiceAccount = "service_account" StorageClasses = "storage_classes" ReplicaSet = "replica_set" Product = "product" LimitRange = "limit_range" ResourceQuota = "resource-quota" VirtualServices = "virtual_services" Gateways = "gateways" DestinationRules = "destination_rules" EnvoyFilters = "envoy_filters" ServiceEntries = "service_entries" Sidecars = "sidecars" Rules = "rules" Instances = "instances" Plugin = "plugin" Inspect = "inspect" PlatformRole = "platform_role" ClusterPlugin = "cluster_plugin" Template = "template" Config = "config" // 数据库表 DataField = "data" ProductTable = "product" AuditLogTable = "audit_log" ClusterTable = "cluster" UserTable = "user" NamespaceTable = "namespace" PluginTable = "plugin" InspectTable = "inspect" InspectInfoTable = "inspect_info" ClusterPluginTable = "cluster_plugin" PlatformRoleTable = "platform_role" TemplateTable = "template" ConfigTable = "config" // 操作类型 Create = ActionType("create") Delete = ActionType("delete") Start = ActionType("start") Restart = ActionType("restart") Patch = ActionType("patch") Scale = ActionType("scale") PatchImage = ActionType("patch_image") PatchSyncImage = ActionType("patch_sync_image") WatchPodIP = ActionType("watch_pod_ip") PatchStepResume = ActionType("patch_step_resume") PatchAllResume = ActionType("patch_all_resume") PatchPause = ActionType("patch_pause") Update = ActionType("update") SaveTemplate = ActionType("save_template") Stop = ActionType("stop") Reboot = ActionType("reboot") Evict = ActionType("evict") Get = ActionType("get") List = ActionType("list") ListAll = ActionType("list_all") Log = ActionType("log") ListPodByNode = ActionType("list_pod_by_node") ListPodByService = ActionType("list_pod_by_service") ListPodByController = ActionType("list_pod_by_controller") NodeMetric = ActionType("node_metric") GetChart = ActionType("get_chart") GetNamespaceIsExistLabel = ActionType("get_namespace_is_exist_label") Debug = ActionType("debug") Rescue = ActionType("rescue") Offline = ActionType("offline") Online = ActionType("online") Kubectl = ActionType("Kubectl") UnKubectl = ActionType("unkubectl") Status = ActionType("status") Form = ActionType("form") Yaml = ActionType("yaml") SaveAsTemplate = ActionType("save as template") DebugPodIPByPod = ActionType("debug podIP by pod") // 错误类型 ContentTypeError = "unknown content type, please specify the type json or yaml" K8SClientSetError = "k8s clientSet Initialization failure: " IstioClientSetError = "isito clientSet Initialization failure: " PrometheusClientSetError = "prometheus clientSet Initialization failure: " ClusterNotExistError = "sql: no rows in result set" // kubectl相关常量 ServiceAccountName = "kingfisher" ClusterRoleBindingName = "kingfisher-cluster-role-binding" KubectlPodName = "king-kubectl-pod" KubectlDeploymentName = "king-kubectl" // grpc server port GRPCPort = ":50000" KingK8S = "king-k8s:50000" KingIstio = "king-istio:50000" KingKf = "king-kf:50000" KubectlNamespace = "default" // MQ Topic UpdateKubeConfig = "Update-Kube-Config" ConfigID = "c_000000000001" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
type AuditLog ¶
type AuditLog struct { Type string `json:"type"` Id string `json:"id"` Name string `json:"name"` Result bool `json:"result"` ProductId string `json:"product_id"` Cluster string `json:"cluster"` ActionType ActionType `json:"action_type"` PostType ActionType `json:"post_type"` ActionTime int64 `json:"action_time"` User string `json:"user"` Msg string `json:"msg"` Json interface{} `json:"json"` Namespace string `json:"namespace"` }
type ClusterDB ¶
type ClusterDB struct { Id string `json:"id"` Name string `json:"name" binding:"required,requiredValidate"` Describe string `json:"describe"` Token string `json:"token" binding:"required,requiredValidate"` CAHash string `json:"ca_hash" binding:"required,requiredValidate"` KubConfig string `json:"kub_config"` Product []string `json:"product"` Version string `json:"version"` CreateTime int64 `json:"createTime"` ModifyTime int64 `json:"modifyTime"` }
type ClusterPluginDB ¶
type ImageList ¶
type ImageList struct { Id int `json:"id"` Name string `json:"name"` ProjectId int `json:"project_id"` Description string `json:"description"` PullCount int `json:"pull_count"` StarCount int `json:"star_count"` TagsCount int `json:"tags_count"` CreationTime interface{} `json:"creation_time"` UpdateTime interface{} `json:"update_time"` }
type ImageTags ¶
type ImageTags struct { Digest string `json:"digest"` Name string `json:"name"` Size int `json:"size"` Architecture string `json:"architecture"` Os string `json:"os"` DockerVersion string `json:"docker_version"` Author string `json:"author"` Created interface{} `json:"created"` Config interface{} `json:"config"` }
type InspectDB ¶
type InspectDB struct { Id string `json:"id"` Name string `json:"name"` Describe string `json:"describe"` Cluster string `json:"cluster"` Level []string `json:"level"` Namespace []string `json:"namespace"` Basic []string `json:"basic"` Unused []string `json:"unused"` State []string `json:"state"` Security []string `json:"security"` User string `json:"user"` Interval string `json:"interval"` Report string `json:"report"` CreateTime int64 `json:"createTime"` ModifyTime int64 `json:"modifyTime"` }
type InspectInfoDB ¶
type NamespaceDB ¶
type PlatformRoleDB ¶
type Projects ¶
type Projects struct { ProjectId int `json:"project_id"` OwnerId int `json:"owner_id"` Name string `json:"name"` CreationTime interface{} `json:"creation_time"` UpdateTime interface{} `json:"update_time"` Deleted int `json:"deleted"` OwnerName string `json:"owner_name"` Togglable bool `json:"togglable"` CurrentUserRoleId int `json:"current_user_role_id"` RepoCount int `json:"repo_count"` Metadata Metadata }
type ResponseData ¶
type TemplateDB ¶
type User ¶
type User struct { Id string `json:"id"` Name string `json:"name" binding:"required,requiredValidate"` RealName string `json:"realName"` Mail string `json:"mail" binding:"required,requiredValidate"` Mobile string `json:"mobile"` Product []string `json:"product"` Cluster []string `json:"cluster"` Namespace []string `json:"namespace"` Role string `json:"role"` Password string `json:"password"` AuthMode string `json:"authMode"` CreateTime int64 `json:"createTime"` ModifyTime int64 `json:"modifyTime"` }
Click to show internal directories.
Click to hide internal directories.