Documentation
¶
Overview ¶
Package vcsprovider is responsible for VCS providers
Index ¶
Constants ¶
View Source
const ( GithubAPIURL = "https://api.github.com" GithubHTTPURL = "https://github.com" )
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(opts Options) *service
Types ¶
type CloudService ¶
type CreateOptions ¶
type Service ¶
type Service interface {
CreateVCSProvider(ctx context.Context, opts CreateOptions) (*VCSProvider, error)
UpdateVCSProvider(ctx context.Context, id string, opts UpdateOptions) (*VCSProvider, error)
GetVCSProvider(ctx context.Context, id string) (*VCSProvider, error)
ListVCSProviders(ctx context.Context, organization string) ([]*VCSProvider, error)
ListAllVCSProviders(ctx context.Context) ([]*VCSProvider, error)
DeleteVCSProvider(ctx context.Context, id string) (*VCSProvider, error)
// GetVCSClient combines retrieving a vcs provider and construct a cloud
// client from that provider.
//
// TODO: rename vcs provider to cloud client; the central purpose of the vcs
// provider is, after all, to construct a cloud client.
GetVCSClient(ctx context.Context, providerID string) (cloud.Client, error)
BeforeDeleteVCSProvider(l hooks.Listener[*VCSProvider])
}
type UpdateOptions ¶ added in v0.1.11
type VCSProvider ¶
type VCSProvider struct {
ID string
CreatedAt time.Time
CloudConfig cloud.Config // cloud config for creating client
Token string // credential for creating client
Organization string // vcs provider belongs to an organization
Name string
}
VCSProvider provides authenticated access to a VCS. Equivalent to an OAuthClient in TFE.
func (*VCSProvider) LogValue ¶
func (t *VCSProvider) LogValue() slog.Value
LogValue implements slog.LogValuer.
func (*VCSProvider) String ¶
func (t *VCSProvider) String() string
String provides a human meaningful description of the vcs provider, using the name if set, otherwise using the name of the underlying cloud provider.
func (*VCSProvider) Update ¶ added in v0.1.11
func (t *VCSProvider) Update(opts UpdateOptions) error
type VCSProviderService ¶
type VCSProviderService Service
Alias services so they don't conflict when nested together in struct
Click to show internal directories.
Click to hide internal directories.