Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContextToConfig ¶ added in v0.5.27
AddContextToConfig adds context passed to it to mesheryctl config file
func AddTokenToConfig ¶ added in v0.5.27
AddTokenToConfig adds token passed to it to mesheryctl config file
Types ¶
type Context ¶
type Context struct { Endpoint string `mapstructure:"endpoint,omitempty"` Token string `mapstructure:"token,omitempty"` Platform string `mapstructure:"platform"` Adapters []string `mapstructure:"adapters,omitempty"` Channel string `mapstructure:"channel,omitempty"` Version string `mapstructure:"version,omitempty"` }
Context defines a meshery environment
func (*Context) ValidateVersion ¶ added in v0.5.2
ValidateVersion checks if the version is valid, if empty sets it to default value latest. Returns an error if the version is invalid.
type MesheryCtlConfig ¶
type MesheryCtlConfig struct { Contexts map[string]Context `mapstructure:"contexts"` CurrentContext string `mapstructure:"current-context"` Tokens []Token `mapstructure:"tokens"` }
MesheryCtlConfig is configuration structure of mesheryctl with contexts
func GetMesheryCtl ¶
func GetMesheryCtl(v *viper.Viper) (*MesheryCtlConfig, error)
GetMesheryCtl returns a reference to the mesheryctl configuration object.
func (*MesheryCtlConfig) CheckIfCurrentContextIsValid ¶
func (mc *MesheryCtlConfig) CheckIfCurrentContextIsValid() (Context, error)
CheckIfCurrentContextIsValid checks if current context is valid
func (*MesheryCtlConfig) GetBaseMesheryURL ¶
func (mc *MesheryCtlConfig) GetBaseMesheryURL() string
GetBaseMesheryURL returns the base meshery server URL
func (*MesheryCtlConfig) GetCurrentContext ¶
func (mc *MesheryCtlConfig) GetCurrentContext() Context
GetCurrentContext returns contents of the current context
func (*MesheryCtlConfig) SetCurrentContext ¶
func (mc *MesheryCtlConfig) SetCurrentContext(contextName string) (Context, error)
SetCurrentContext sets current context and returns contents of the current context
type Version ¶
type Version struct { Build string `json:"build,omitempty"` CommitSHA string `json:"commitsha,omitempty"` ReleaseChannel string `json:"release_channel,omitempty"` }
Version unmarshals the json response from the server's version api
func (*Version) GetCommitSHA ¶
GetCommitSHA returns the commit sha for the binary