Documentation
¶
Overview ¶
Copyright © 2019 Portworx
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type ClientContext
- type ClientTLSInfo
- type ConfigReference
- func (cr *ConfigReference) Add(cctx *ClientContext) error
- func (cr *ConfigReference) GetAll() (*ContextConfig, error)
- func (cr *ConfigReference) GetCurrent() (*ClientContext, error)
- func (cr *ConfigReference) GetNamedContext(name string) (*ClientContext, error)
- func (cr *ConfigReference) Remove(cctx *ClientContext) error
- func (cr *ConfigReference) Set(cctx *ClientContext) error
- func (cr *ConfigReference) UnSet(cctx *ClientContext) error
- type ContextConfig
- type Identity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientContext ¶
type ClientContext struct { Name string `json:"context" yaml:"context"` Token string `json:"token" yaml:"token"` Identity Identity `json:"identity,omitempty" yaml:"identity,omitempty"` Error string `json:"error,omitempty" yaml:"error,omitempty"` TlsData ClientTLSInfo `json:"tlsdata,omitempty" yaml:"tlsdata,omitempty"` Endpoint string `json:"endpoint" yaml:"endpoint"` Secure bool `json:"secure" yaml:"secure"` Kubeconfig string `json:"kubeconfig" yaml:"kubeconfig"` }
ClientContext provides information about the client context
type ClientTLSInfo ¶
type ClientTLSInfo struct {
Cacert string `json:"cacert" yaml:"cacert"`
}
ClientTLSInfo provide client TLS configuration information
type ConfigReference ¶
type ConfigReference struct {
// contains filtered or unexported fields
}
ConfigReference is a reference to a ContextConfig and the path associated with it
func NewConfigReference ¶
func NewConfigReference(configFile string) *ConfigReference
NewContextConfig
func (*ConfigReference) Add ¶
func (cr *ConfigReference) Add(cctx *ClientContext) error
TODO: Return error if exists already TODO: Add Update support
func (*ConfigReference) GetAll ¶
func (cr *ConfigReference) GetAll() (*ContextConfig, error)
func (*ConfigReference) GetCurrent ¶
func (cr *ConfigReference) GetCurrent() (*ClientContext, error)
func (*ConfigReference) GetNamedContext ¶
func (cr *ConfigReference) GetNamedContext(name string) (*ClientContext, error)
TODO have GetNamedContext and GetCurrent() call a common helper function
func (*ConfigReference) Set ¶
func (cr *ConfigReference) Set(cctx *ClientContext) error
func (*ConfigReference) UnSet ¶
func (cr *ConfigReference) UnSet(cctx *ClientContext) error
type ContextConfig ¶
type ContextConfig struct { Current string `json:"current" yaml:"current"` Configurations []ClientContext `json:"configurations" yaml:"configurations"` }
ContextConfig provides information about the px context information