Documentation ¶
Index ¶
- Constants
- func GetClusterID(o *options.KubeDriverServerOptions) (clusterID string, err error)
- func GetServerInfo(opts *options.KubeDriverServerOptions, clusterID string) types.ServerInfo
- func RouteByMethodName(w *restful.WebService, methodName string, subPath string) *restful.RouteBuilder
- func StartServer(o *options.KubeDriverServerOptions) error
- type APIGWAuthHeaders
- type AccessTokenRequestBody
- type DriverServer
- type KubeAPIPrefer
- type KubeSmartProxier
- func (c *KubeSmartProxier) ForwardToKubeAPI(request *restful.Request, response *restful.Response)
- func (c *KubeSmartProxier) GeneralAPIHandle(request *restful.Request, response *restful.Response)
- func (c *KubeSmartProxier) IfKubeNeedTls() bool
- func (c *KubeSmartProxier) RegisterToWS(ws *restful.WebService)
- func (c *KubeSmartProxier) RequestAPIPrefer() error
- func (c *KubeSmartProxier) RequestServerVersion() (KubeVersion, error)
- type KubeVersion
Constants ¶
View Source
const ( DefaultKubeURLPrefix = "k8sdriver/v4" MetricPort = 9090 ModuleName = "k8s-driver" )
View Source
const ( Module = "BCS-API-Tunnel-Module" RegisterToken = "BCS-API-Tunnel-Token" Params = "BCS-API-Tunnel-Params" Cluster = "BCS-API-Tunnel-ClusterId" )
View Source
const CodeRequestFailed = 4001
View Source
const CodeRequestSuccess = 0
Variables ¶
This section is empty.
Functions ¶
func GetClusterID ¶
func GetClusterID(o *options.KubeDriverServerOptions) (clusterID string, err error)
func GetServerInfo ¶
func GetServerInfo(opts *options.KubeDriverServerOptions, clusterID string) types.ServerInfo
GetServerInfo returns server info of current driver node
func RouteByMethodName ¶
func RouteByMethodName(w *restful.WebService, methodName string, subPath string) *restful.RouteBuilder
RouteByMethodName accepts a dynamic method name, this function uses reflect module
func StartServer ¶
func StartServer(o *options.KubeDriverServerOptions) error
StartServer start driver server
Types ¶
type APIGWAuthHeaders ¶
type APIGWAuthHeaders struct {
AccessToken string `json:"access_token"`
}
type AccessTokenRequestBody ¶
type DriverServer ¶
type DriverServer struct { RootWebContainer *restful.Container Options *options.KubeDriverServerOptions }
func NewDriverServer ¶
func NewDriverServer(o *options.KubeDriverServerOptions) DriverServer
NewDriverServer Create a new DriverServer instance
type KubeAPIPrefer ¶
type KubeAPIPrefer struct { Groups []struct { Name string `json:"name"` Versions []struct { GroupVersion string `json:"groupVersion"` Version string `json:"version"` } `json:"versions"` PreferredVersion struct { GroupVersion string `json:"groupVersion"` Version string `json:"version"` } `json:"preferredVersion"` } `json:"groups"` }
func (KubeAPIPrefer) Map ¶
func (p KubeAPIPrefer) Map() map[string]string
type KubeSmartProxier ¶
type KubeSmartProxier struct { KubeMasterURL string TLSConfig options.TLSConfig KubeURLPrefix string // contains filtered or unexported fields }
func NewKubeSmartProxier ¶
func NewKubeSmartProxier(kubeMasterURL string, TLSConfig options.TLSConfig) KubeSmartProxier
func (*KubeSmartProxier) ForwardToKubeAPI ¶
func (c *KubeSmartProxier) ForwardToKubeAPI(request *restful.Request, response *restful.Response)
ForwardToKubeAPI forwards incoming request to kubernetes API Server
func (*KubeSmartProxier) GeneralAPIHandle ¶
func (c *KubeSmartProxier) GeneralAPIHandle(request *restful.Request, response *restful.Response)
GeneralAPIHandle create
func (*KubeSmartProxier) IfKubeNeedTls ¶
func (c *KubeSmartProxier) IfKubeNeedTls() bool
func (*KubeSmartProxier) RegisterToWS ¶
func (c *KubeSmartProxier) RegisterToWS(ws *restful.WebService)
RegisterToWS registers a smart Kube API Proxy client to a go-restful WebService
func (*KubeSmartProxier) RequestAPIPrefer ¶
func (c *KubeSmartProxier) RequestAPIPrefer() error
RequestServerVersion request API server to get version
func (*KubeSmartProxier) RequestServerVersion ¶
func (c *KubeSmartProxier) RequestServerVersion() (KubeVersion, error)
RequestServerVersion request API server to get version
type KubeVersion ¶
func (KubeVersion) IsValid ¶
func (v KubeVersion) IsValid() bool
func (KubeVersion) String ¶
func (v KubeVersion) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.