Documentation
¶
Overview ¶
Package github provides GitHub-specific setup helpers including token resolution from configuration and environment, and authenticated HTTP client construction for use with the GitHub API.
Index ¶
- Variables
- func ConfigureSSHKey(props *props.Props, cfg config.Containable, opts ...ConfigureSSHKeyOption) (string, string, error)
- func NewCmdInitGitHub(p *props.Props) *cobra.Command
- func RunGitHubInit(p *props.Props, cfg config.Containable) error
- func RunInitCmd(p *props.Props, dir string) error
- type ConfigureSSHKeyOption
- type GenerateKeyOption
- type GitHubInitialiser
Constants ¶
This section is empty.
Variables ¶
var (
GitHubHost = "github.com"
)
Functions ¶
func ConfigureSSHKey ¶
func ConfigureSSHKey(props *props.Props, cfg config.Containable, opts ...ConfigureSSHKeyOption) (string, string, error)
ConfigureSSHKey runs the interactive SSH key configuration flow.
func NewCmdInitGitHub ¶
NewCmdInitGitHub creates the `init github` subcommand.
func RunGitHubInit ¶
func RunGitHubInit(p *props.Props, cfg config.Containable) error
RunGitHubInit forcibly runs both login and SSH configuration regardless of current state. This is used by the explicit `init github` command.
Types ¶
type ConfigureSSHKeyOption ¶
type ConfigureSSHKeyOption func(*configureSSHKeyConfig)
ConfigureSSHKeyOption is a functional option for ConfigureSSHKey.
func WithGenerateKeyOptions ¶
func WithGenerateKeyOptions(opts ...GenerateKeyOption) ConfigureSSHKeyOption
WithGenerateKeyOptions passes options through to the key generation step.
func WithSSHKeyPathForm ¶
func WithSSHKeyPathForm(creator func(*string) *huh.Form) ConfigureSSHKeyOption
WithSSHKeyPathForm overrides the SSH key path input form (for testing).
func WithSSHKeySelectForm ¶
func WithSSHKeySelectForm(creator func(*string, []huh.Option[string]) *huh.Form) ConfigureSSHKeyOption
WithSSHKeySelectForm overrides the SSH key selection form (for testing).
type GenerateKeyOption ¶
type GenerateKeyOption func(*generateKeyConfig)
GenerateKeyOption is a functional option for SSH key generation.
func WithPassphraseForm ¶
func WithPassphraseForm(creator func(*string) *huh.Form) GenerateKeyOption
WithPassphraseForm overrides the passphrase input form (for testing).
func WithUploadConfirmForm ¶
func WithUploadConfirmForm(creator func(*bool) *huh.Form) GenerateKeyOption
WithUploadConfirmForm overrides the upload confirmation form (for testing).
type GitHubInitialiser ¶
GitHubInitialiser handles both GitHub authentication and SSH key configuration.
func NewGitHubInitialiser ¶
func NewGitHubInitialiser(p *props.Props, skipLogin, skipKey bool) *GitHubInitialiser
NewGitHubInitialiser creates a new GitHubInitialiser and mounts its assets.
func (*GitHubInitialiser) Configure ¶
func (g *GitHubInitialiser) Configure(props *props.Props, cfg config.Containable) error
Configure runs the interactive login and/or SSH configuration.
func (*GitHubInitialiser) IsConfigured ¶
func (g *GitHubInitialiser) IsConfigured(cfg config.Containable) bool
IsConfigured returns true if unskipped components are already present in the config.
func (*GitHubInitialiser) Name ¶
func (g *GitHubInitialiser) Name() string