cmd

package
v0.0.0-alpha.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var BuildTime = "unknown"
View Source
var GitCommit = "unknown"
View Source
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

func Execute

func Execute()

func SavePasswordWithMessages

func SavePasswordWithMessages(service api.Service, password string, output io.Writer) error

SavePasswordWithMessages handles saving a password and displaying appropriate messages

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) Get

func (k *KeyringStorage) Get(service api.Service) (string, error)

func (*KeyringStorage) HandleSaveMessage

func (k *KeyringStorage) HandleSaveMessage(err error, password string, output io.Writer)

func (*KeyringStorage) Remove

func (k *KeyringStorage) Remove(service api.Service) error

func (*KeyringStorage) Save

func (k *KeyringStorage) Save(service api.Service, password string) error

type NoStorage

type NoStorage struct{}

NoStorage implements no password storage (passwords are not saved)

func (*NoStorage) Get

func (n *NoStorage) Get(service api.Service) (string, error)

func (*NoStorage) HandleSaveMessage

func (n *NoStorage) HandleSaveMessage(err error, password string, output io.Writer)

func (*NoStorage) Remove

func (n *NoStorage) Remove(service api.Service) error

func (*NoStorage) Save

func (n *NoStorage) Save(service api.Service, password string) error

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) Get

func (p *PgpassStorage) Get(service api.Service) (string, error)

func (*PgpassStorage) HandleSaveMessage

func (p *PgpassStorage) HandleSaveMessage(err error, password string, output io.Writer)

func (*PgpassStorage) Remove

func (p *PgpassStorage) Remove(service api.Service) error

func (*PgpassStorage) Save

func (p *PgpassStorage) Save(service api.Service, password string) error

type Project

type Project struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Project represents a project from the GraphQL API

type User

type User struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
}

User represents a user from the GraphQL API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL