Documentation
¶
Index ¶
- Variables
- func NewAccountList(fs afero.Fs, log logging.Logger) *defaultAccountList
- type Account
- type AccountAuthType
- type AccountList
- type AccountProvider
- type AccountSource
- type CredentialsProvider
- type MockAccountList
- func (m *MockAccountList) GetAccountByName(name string) (*Account, error)
- func (m *MockAccountList) GetAccountByServerURL(url string) (*Account, error)
- func (m *MockAccountList) GetAccountsByServerType(serverType ServerType) ([]Account, error)
- func (m *MockAccountList) GetAllAccounts() ([]Account, error)
- type MockAccountProvider
- type ServerType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAccountNotFound = errors.New("no such account")
Functions ¶
Types ¶
type Account ¶
type Account struct { ServerType ServerType `json:"type"` // Which type of API this server provides Source AccountSource `json:"source"` // Source of the saved server configuration AuthType AccountAuthType `json:"auth_type"` // Authentication method (API key, token, etc) Name string `json:"name"` // Nickname URL string `json:"url"` // Server URL, e.g. https://connect.example.com/rsc Insecure bool `json:"insecure"` // Skip https server verification Certificate string `json:"-"` // Root CA certificate, if server cert is signed by a private CA AccountName string `json:"account_name"` // Username, if known ApiKey string `json:"-"` // For Connect servers }
func (*Account) InferAuthType ¶
func (acct *Account) InferAuthType() AccountAuthType
type AccountAuthType ¶
type AccountAuthType string
const ( AuthTypeNone AccountAuthType = "none" // No saved credentials AuthTypeAPIKey AccountAuthType = "api-key" // Connect API key )
func (AccountAuthType) Description ¶
func (auth AccountAuthType) Description() string
type AccountList ¶
type AccountProvider ¶
type AccountSource ¶
type AccountSource string
const ( AccountSourceRsconnectPython AccountSource = "rsconnect-python" AccountSourceRsconnect AccountSource = "rsconnect" AccountSourceEnvironment AccountSource = "environment" AccountSourceKeychain AccountSource = "keychain" )
func (AccountSource) Description ¶
func (source AccountSource) Description() string
type CredentialsProvider ¶
type CredentialsProvider struct {
// contains filtered or unexported fields
}
func NewCredentialsProvider ¶
func NewCredentialsProvider() *CredentialsProvider
func (*CredentialsProvider) Load ¶
func (p *CredentialsProvider) Load() ([]Account, error)
type MockAccountList ¶
type MockAccountList struct { mock.Mock AccountList }
func NewMockAccountList ¶
func NewMockAccountList() *MockAccountList
func (*MockAccountList) GetAccountByName ¶
func (m *MockAccountList) GetAccountByName(name string) (*Account, error)
func (*MockAccountList) GetAccountByServerURL ¶
func (m *MockAccountList) GetAccountByServerURL(url string) (*Account, error)
func (*MockAccountList) GetAccountsByServerType ¶
func (m *MockAccountList) GetAccountsByServerType(serverType ServerType) ([]Account, error)
func (*MockAccountList) GetAllAccounts ¶
func (m *MockAccountList) GetAllAccounts() ([]Account, error)
type MockAccountProvider ¶
func (*MockAccountProvider) Load ¶
func (m *MockAccountProvider) Load() ([]Account, error)
type ServerType ¶
type ServerType string
const ( ServerTypeConnect ServerType = "connect" ServerTypeShinyappsIO ServerType = "shinyapps" ServerTypeCloud ServerType = "cloud" )
func (ServerType) Description ¶
func (t ServerType) Description() string
Click to show internal directories.
Click to hide internal directories.