Documentation
¶
Index ¶
- Constants
- Variables
- func Execute()
- func SavePasswordWithMessages(service api.Service, password string, output io.Writer) error
- type ArgsLenAtDashProvider
- type CPUMemoryConfig
- type CreatePATRecordData
- type GetAllProjectsData
- type GetUserData
- type GraphQLClient
- type GraphQLError
- type GraphQLResponse
- type KeyringStorage
- type NoStorage
- type PATRecordResponse
- type PasswordStorage
- type PgpassStorage
- type Project
- type User
Constants ¶
const ( ExitSuccess = 0 // Success ExitGeneralError = 1 // General error ExitTimeout = 2 // Operation timeout (wait-timeout exceeded) or connection timeout ExitInvalidParameters = 3 // Invalid parameters ExitAuthenticationError = 4 // Authentication error ExitPermissionDenied = 5 // Permission denied ExitServiceNotFound = 6 // Service not found )
Exit codes as defined in the CLI specification
Variables ¶
var BuildTime = "unknown"
var GitCommit = "unknown"
var Version = "dev"
These variables are set at build time via ldflags in the GoReleaser pipeline for production releases. Default values are used for local development builds.
Functions ¶
Types ¶
type ArgsLenAtDashProvider ¶
type ArgsLenAtDashProvider interface {
ArgsLenAtDash() int
}
ArgsLenAtDashProvider defines the interface for getting ArgsLenAtDash
type CPUMemoryConfig ¶
type CPUMemoryConfig struct {
CPUMillis int // CPU in millicores
MemoryGbs float64 // Memory in GB
}
CPUMemoryConfig represents an allowed CPU/Memory configuration
type CreatePATRecordData ¶
type CreatePATRecordData struct {
CreatePATRecord PATRecordResponse `json:"createPATRecord"`
}
CreatePATRecordData represents the data from the createPATRecord mutation
type GetAllProjectsData ¶
type GetAllProjectsData struct {
GetAllProjects []Project `json:"getAllProjects"`
}
GetAllProjectsData represents the data from the getAllProjects query
type GetUserData ¶
type GetUserData struct {
GetUser User `json:"getUser"`
}
GetUserData represents the data from the getUser query
type GraphQLClient ¶
type GraphQLClient struct {
URL string
}
We currently use a few GraphQL endpoints as part of the OAuth login flow, because they were already available and they accept the OAuth access token for authentication (whereas savannah-public only accepts the client credentials/API Key).
type GraphQLError ¶
type GraphQLError struct {
Message string `json:"message"`
}
GraphQLError represents an error returned in a GraphQL response
type GraphQLResponse ¶
type GraphQLResponse[T any] struct { Data *T `json:"data"` Errors []GraphQLError `json:"errors,omitempty"` }
GraphQLResponse represents a generic GraphQL response wrapper
type KeyringStorage ¶
type KeyringStorage struct{}
KeyringStorage implements password storage using system keyring
func (*KeyringStorage) HandleSaveMessage ¶
func (k *KeyringStorage) HandleSaveMessage(err error, password string, output io.Writer)
type NoStorage ¶
type NoStorage struct{}
NoStorage implements no password storage (passwords are not saved)
func (*NoStorage) HandleSaveMessage ¶
type PATRecordResponse ¶
type PATRecordResponse struct {
ClientCredentials struct {
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
} `json:"clientCredentials"`
}
PATRecordResponse represents the response from creating a PAT record
type PasswordStorage ¶
type PasswordStorage interface {
Save(service api.Service, password string) error
Get(service api.Service) (string, error)
Remove(service api.Service) error
HandleSaveMessage(err error, password string, output io.Writer)
}
PasswordStorage defines the interface for password storage implementations
func GetPasswordStorage ¶
func GetPasswordStorage() PasswordStorage
GetPasswordStorage returns the appropriate PasswordStorage implementation based on configuration
type PgpassStorage ¶
type PgpassStorage struct{}
PgpassStorage implements password storage using ~/.pgpass file
func (*PgpassStorage) HandleSaveMessage ¶
func (p *PgpassStorage) HandleSaveMessage(err error, password string, output io.Writer)