Documentation ¶
Index ¶
- Constants
- type AuthConfig
- func (c *AuthConfig) DeleteServer(url string)
- func (config *AuthConfig) EditUserAuth(serverLabel string, auth *UserAuth, defaultUserName string, ...) error
- func (c *AuthConfig) FindUserAuth(serverURL string, username string) *UserAuth
- func (c *AuthConfig) FindUserAuths(serverURL string) []*UserAuth
- func (c *AuthConfig) GetOrCreateServer(url string) *AuthServer
- func (c *AuthConfig) GetOrCreateServerName(url string, name string, kind string) *AuthServer
- func (c *AuthConfig) GetOrCreateUserAuth(url string, username string) *UserAuth
- func (c *AuthConfig) GetServer(url string) *AuthServer
- func (c *AuthConfig) GetServerByKind(kind string) *AuthServer
- func (c *AuthConfig) GetServerByName(name string) *AuthServer
- func (config *AuthConfig) GetServerNames() []string
- func (config *AuthConfig) GetServerURLs() []string
- func (config *AuthConfig) IndexOfServerName(name string) int
- func (config *AuthConfig) PickOrCreateServer(defaultServerURL string, message string, batchMode bool, ...) (*AuthServer, error)
- func (c *AuthConfig) PickServer(message string, batchMode bool, in terminal.FileReader, ...) (*AuthServer, error)
- func (c *AuthConfig) PickServerUserAuth(server *AuthServer, message string, batchMode bool, org string, ...) (*UserAuth, error)
- func (c *AuthConfig) SetUserAuth(url string, auth *UserAuth)
- type AuthConfigService
- func (s *AuthConfigService) Config() *AuthConfig
- func (s *AuthConfigService) DeleteServer(url string) error
- func (s *AuthConfigService) HasConfigFile() (bool, error)
- func (s *AuthConfigService) LoadConfig() (*AuthConfig, error)
- func (s *AuthConfigService) SaveConfig() error
- func (s *AuthConfigService) SaveUserAuth(url string, userAuth *UserAuth) error
- func (s *AuthConfigService) SetConfig(c *AuthConfig)
- type AuthServer
- type PrintUserFn
- type UserAuth
Constants ¶
const (
DefaultWritePermissions = 0760
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct { Servers []*AuthServer DefaultUsername string PipeLineUsername string CurrentServer string PipeLineServer string }
func (*AuthConfig) DeleteServer ¶ added in v1.2.105
func (c *AuthConfig) DeleteServer(url string)
DeleteServer deletes the server for the given URL and updates the current server if is the same with the deleted server
func (*AuthConfig) EditUserAuth ¶
func (config *AuthConfig) EditUserAuth(serverLabel string, auth *UserAuth, defaultUserName string, editUser, batchMode bool, fn PrintUserFn, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) error
EditUserAuth Lets the user input/edit the user auth
func (*AuthConfig) FindUserAuth ¶
func (c *AuthConfig) FindUserAuth(serverURL string, username string) *UserAuth
FindUserAuth finds the auth for the given user name if no username is specified and there is only one auth then return that else nil
func (*AuthConfig) FindUserAuths ¶
func (c *AuthConfig) FindUserAuths(serverURL string) []*UserAuth
func (*AuthConfig) GetOrCreateServer ¶
func (c *AuthConfig) GetOrCreateServer(url string) *AuthServer
func (*AuthConfig) GetOrCreateServerName ¶ added in v1.0.16
func (c *AuthConfig) GetOrCreateServerName(url string, name string, kind string) *AuthServer
func (*AuthConfig) GetOrCreateUserAuth ¶
func (c *AuthConfig) GetOrCreateUserAuth(url string, username string) *UserAuth
func (*AuthConfig) GetServer ¶
func (c *AuthConfig) GetServer(url string) *AuthServer
GetServerByName returns the server for the given URL or null if its not found
func (*AuthConfig) GetServerByKind ¶ added in v1.1.69
func (c *AuthConfig) GetServerByKind(kind string) *AuthServer
GetServerByKind returns the server for the given kind or null if its not found
func (*AuthConfig) GetServerByName ¶ added in v1.0.40
func (c *AuthConfig) GetServerByName(name string) *AuthServer
GetServerByName returns the server for the given name or null if its not found
func (*AuthConfig) GetServerNames ¶ added in v1.0.39
func (config *AuthConfig) GetServerNames() []string
func (*AuthConfig) GetServerURLs ¶ added in v1.0.40
func (config *AuthConfig) GetServerURLs() []string
func (*AuthConfig) IndexOfServerName ¶ added in v1.0.39
func (config *AuthConfig) IndexOfServerName(name string) int
func (*AuthConfig) PickOrCreateServer ¶ added in v1.1.15
func (config *AuthConfig) PickOrCreateServer(defaultServerURL string, message string, batchMode bool, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) (*AuthServer, error)
PickOrCreateServer picks the server to use defaulting to the current server
func (*AuthConfig) PickServer ¶
func (c *AuthConfig) PickServer(message string, batchMode bool, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) (*AuthServer, error)
func (*AuthConfig) PickServerUserAuth ¶
func (c *AuthConfig) PickServerUserAuth(server *AuthServer, message string, batchMode bool, org string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (*UserAuth, error)
PickServerAuth Pick the servers auth
func (*AuthConfig) SetUserAuth ¶
func (c *AuthConfig) SetUserAuth(url string, auth *UserAuth)
type AuthConfigService ¶
type AuthConfigService struct { FileName string // contains filtered or unexported fields }
AuthConfigService is a service for handing the config of auth tokens
func (*AuthConfigService) Config ¶
func (s *AuthConfigService) Config() *AuthConfig
func (*AuthConfigService) DeleteServer ¶ added in v1.2.105
func (s *AuthConfigService) DeleteServer(url string) error
DeleteServer removes the given server from the configuration
func (*AuthConfigService) HasConfigFile ¶ added in v1.0.129
func (s *AuthConfigService) HasConfigFile() (bool, error)
HasConfigFile returns true if we have a config file
func (*AuthConfigService) LoadConfig ¶
func (s *AuthConfigService) LoadConfig() (*AuthConfig, error)
LoadConfig loads the configuration from the users JX config directory
func (*AuthConfigService) SaveConfig ¶
func (s *AuthConfigService) SaveConfig() error
SaveConfig saves the configuration to disk
func (*AuthConfigService) SaveUserAuth ¶
func (s *AuthConfigService) SaveUserAuth(url string, userAuth *UserAuth) error
SaveUserAuth saves the given user auth for the server url
func (*AuthConfigService) SetConfig ¶
func (s *AuthConfigService) SetConfig(c *AuthConfig)
type AuthServer ¶
func (*AuthServer) DeleteUser ¶ added in v1.0.40
func (s *AuthServer) DeleteUser(username string) error
func (*AuthServer) Description ¶
func (s *AuthServer) Description() string
func (*AuthServer) GetUsernames ¶ added in v1.0.40
func (s *AuthServer) GetUsernames() []string
func (*AuthServer) Label ¶
func (s *AuthServer) Label() string