[Lint Issue] returning unexported type
* exported func NewClient returns unexported type *ctl.client, which can be annoying to use Change-Id: Ica2a37e329321f2fa179bafa1215b43ff1cff96c
This commit is contained in:
parent
4e25c19021
commit
b42f594bdb
@ -37,18 +37,18 @@ type ctlPage struct {
|
||||
ButtonText string
|
||||
}
|
||||
|
||||
// client provides a library of functions that enable external programs (e.g. Airship UI) to perform airshipctl
|
||||
// Client provides a library of functions that enable external programs (e.g. Airship UI) to perform airshipctl
|
||||
// functionality in exactly the same manner as the CLI.
|
||||
type client struct {
|
||||
type Client struct {
|
||||
settings *environment.AirshipCTLSettings
|
||||
}
|
||||
|
||||
// NewClient initializes the airshipctl client for external usage.
|
||||
func NewClient() *client {
|
||||
func NewClient() *Client {
|
||||
settings := &environment.AirshipCTLSettings{}
|
||||
settings.InitConfig()
|
||||
|
||||
c := &client{
|
||||
c := &Client{
|
||||
settings: settings,
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ func NewClient() *client {
|
||||
}
|
||||
|
||||
// initilize the connection to airshipctl
|
||||
var c *client = NewClient()
|
||||
var c *Client = NewClient()
|
||||
|
||||
// GetAirshipCTLVersion will kick out what version of airshipctl we're using
|
||||
func getAirshipCTLVersion() string {
|
||||
|
@ -55,7 +55,7 @@ func HandleBaremetalRequest(request configs.WsMessage) configs.WsMessage {
|
||||
return response
|
||||
}
|
||||
|
||||
func (c *client) generateIso() (string, error) {
|
||||
func (c *Client) generateIso() (string, error) {
|
||||
var message string
|
||||
err := isogen.GenerateBootstrapIso(c.settings)
|
||||
if err == nil {
|
||||
|
@ -54,7 +54,7 @@ func HandleConfigRequest(request configs.WsMessage) configs.WsMessage {
|
||||
}
|
||||
|
||||
// GetCluster gets cluster information from the airshipctl config
|
||||
func (c *client) getCluster() []*config.Cluster {
|
||||
func (c *Client) getCluster() []*config.Cluster {
|
||||
return c.settings.Config.GetClusters()
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ func getClusterTableRows() string {
|
||||
}
|
||||
|
||||
// GetContext gets cluster information from the airshipctl config
|
||||
func (c *client) getContext() []*config.Context {
|
||||
func (c *Client) getContext() []*config.Context {
|
||||
return c.settings.Config.GetContexts()
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ func getContextTableRows() string {
|
||||
}
|
||||
|
||||
// GetCredential gets user credentials from the airshipctl config
|
||||
func (c *client) getCredential() []*config.AuthInfo {
|
||||
func (c *Client) getCredential() []*config.AuthInfo {
|
||||
authinfo, err := c.settings.Config.GetAuthInfos()
|
||||
if err != nil {
|
||||
return []*config.AuthInfo{}
|
||||
|
@ -49,7 +49,7 @@ func HandleDocumentRequest(request configs.WsMessage) configs.WsMessage {
|
||||
return response
|
||||
}
|
||||
|
||||
func (c *client) docPull() (string, error) {
|
||||
func (c *Client) docPull() (string, error) {
|
||||
var message string
|
||||
settings := pull.Settings{AirshipCTLSettings: c.settings}
|
||||
err := settings.Pull()
|
||||
|
Loading…
x
Reference in New Issue
Block a user