contextconfig

package
v0.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

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

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) Remove

func (cr *ConfigReference) Remove(cctx *ClientContext) error

TODO:

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

type Identity

type Identity struct {
	Subject string `json:"subject,omitempty" yaml:"subject,omitempty"`
	Name    string `json:"name,omitempty" yaml:"name,omitempty"`
	Email   string `json:"email,omitempty" yaml:"email,omitempty"`
}

Identity contains token unqiue ID information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL