Documentation
¶
Index ¶
- func AddBadgeToReadme(silent bool) (bool, error)
- func EnsureLogin() (string, error)
- func Execute(ver string) error
- func FindReadmePath(dir string) string
- func GenerateBadge(repo string) string
- func InsertBadgeIntoReadme(content, badge string) string
- func RunConnectCommand(provider string) error
- func RunDeviceLogin() (string, error)
- type APIClientFactory
- type AuthProvider
- type AuthStore
- type BrowserOpener
- type CommandRunner
- type Dependencies
- type DiffEntry
- type DiffOptions
- type DiffResult
- type DiffStats
- type DoctorOptions
- type EnvCandidate
- type EnvHelper
- type FileInfo
- type FileStat
- type FileSystem
- type FileWalker
- type Finding
- type GitClient
- type HTTPClient
- type InitOptions
- type MonorepoInfo
- type ProjectWithLinkedRepo
- type PullOptions
- type PushOptions
- type RunOptions
- type ScanResult
- type SecretPattern
- type SetOptions
- type StoredAuthInfo
- type UIProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBadgeToReadme ¶
AddBadgeToReadme adds the Keyway badge to the README file Returns true if badge was added, false if already present or error
func EnsureLogin ¶
EnsureLogin ensures the user is logged in, prompting if necessary
func FindReadmePath ¶
FindReadmePath looks for README.md in the given directory
func GenerateBadge ¶
GenerateBadge creates the markdown badge for a repository
func InsertBadgeIntoReadme ¶
InsertBadgeIntoReadme inserts the badge into README content
func RunConnectCommand ¶
RunConnectCommand runs the connect command (for use by sync command)
func RunDeviceLogin ¶
RunDeviceLogin runs the device login flow and returns the token
Types ¶
type APIClientFactory ¶
APIClientFactory creates API clients
type AuthProvider ¶
AuthProvider abstracts authentication for testing
type AuthStore ¶
type AuthStore interface {
GetAuth() (*StoredAuthInfo, error)
}
AuthStore abstracts auth storage for testing
type BrowserOpener ¶
BrowserOpener abstracts browser operations for testing
type CommandRunner ¶
type CommandRunner interface {
RunCommand(name string, args []string, secrets map[string]string) error
}
CommandRunner abstracts command execution for testing
type Dependencies ¶
type Dependencies struct {
Git GitClient
Auth AuthProvider
UI UIProvider
FS FileSystem
Env EnvHelper
APIFactory APIClientFactory
CmdRunner CommandRunner
Browser BrowserOpener
Walker FileWalker
Stat FileStat
AuthStore AuthStore
HTTP HTTPClient
}
Dependencies holds all external dependencies for commands
func DefaultDeps ¶
func DefaultDeps() *Dependencies
DefaultDeps returns the default (real) dependencies
type DiffOptions ¶
DiffOptions contains the parsed flags for the diff command
type DiffResult ¶
type DiffResult struct {
Env1 string `json:"env1"`
Env2 string `json:"env2"`
OnlyInEnv1 []string `json:"onlyInEnv1"`
OnlyInEnv2 []string `json:"onlyInEnv2"`
Different []DiffEntry `json:"different"`
Same []string `json:"same"`
Stats DiffStats `json:"stats"`
}
DiffResult represents the comparison between two environments
type DoctorOptions ¶
DoctorOptions contains the parsed flags for the doctor command
type EnvCandidate ¶
EnvCandidate represents a discovered env file
type EnvHelper ¶
type EnvHelper interface {
Discover() []EnvCandidate
DeriveEnvFromFile(file string) string
}
EnvHelper abstracts env file operations for testing
type FileSystem ¶
type FileSystem interface {
ReadFile(name string) ([]byte, error)
WriteFile(name string, data []byte, perm uint32) error
}
FileSystem abstracts file operations for testing
type FileWalker ¶
type FileWalker interface {
Walk(root string, fn func(path string, info FileInfo, err error) error) error
}
FileWalker abstracts directory walking for testing
type Finding ¶
type Finding struct {
File string `json:"file"`
Line int `json:"line"`
Type string `json:"type"`
Match string `json:"match,omitempty"`
Preview string `json:"preview"`
}
Finding represents a detected secret
type GitClient ¶
type GitClient interface {
DetectRepo() (string, error)
CheckEnvGitignore() bool
AddEnvToGitignore() error
IsGitRepository() bool
DetectMonorepo() MonorepoInfo
}
GitClient abstracts git operations for testing
type HTTPClient ¶
HTTPClient abstracts HTTP operations for testing
type InitOptions ¶
type InitOptions struct {
}
InitOptions contains the parsed flags for the init command
type MonorepoInfo ¶ added in v0.4.1
MonorepoInfo contains information about detected monorepo setup
type ProjectWithLinkedRepo ¶
type ProjectWithLinkedRepo struct {
ID string
Name string
ServiceID *string
ServiceName *string
LinkedRepo *string
Environments []string
ConnectionID string
TeamID *string
TeamName *string
}
ProjectWithLinkedRepo represents a provider project with metadata
type PullOptions ¶
PullOptions contains the parsed flags for the pull command
type PushOptions ¶
PushOptions contains the parsed flags for the push command
type RunOptions ¶
RunOptions contains the parsed flags for the run command
type ScanResult ¶
type ScanResult struct {
FilesScanned int `json:"filesScanned"`
Findings []Finding `json:"findings"`
}
ScanResult represents the complete scan output
type SecretPattern ¶
SecretPattern defines a pattern for detecting secrets
type SetOptions ¶ added in v0.5.0
type SetOptions struct {
Key string
Value string
EnvName string
LocalOnly bool
Yes bool
EnvFlagSet bool
}
SetOptions contains the parsed flags for the set command
type StoredAuthInfo ¶
StoredAuthInfo contains stored authentication information
type UIProvider ¶
type UIProvider interface {
Intro(command string)
Outro(message string)
Success(message string)
Error(message string)
Warn(message string)
Info(message string)
Step(message string)
Message(message string)
IsInteractive() bool
Confirm(message string, defaultValue bool) (bool, error)
Select(message string, options []string) (string, error)
Password(prompt string) (string, error)
Spin(message string, fn func() error) error
Value(v interface{}) string
File(path string) string
Link(url string) string
Command(cmd string) string
Bold(text string) string
Dim(text string) string
DiffAdded(key string)
DiffChanged(key string)
DiffRemoved(key string)
DiffKept(key string)
}
UIProvider abstracts UI operations for testing