repos

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGitProviderFromUrl

func GetGitProviderFromUrl(uri string) string

func ResourceGitCredential

func ResourceGitCredential() common.Resource

func ResourceRepo

func ResourceRepo() common.Resource

Types

type ReposAPI

type ReposAPI struct {
	// contains filtered or unexported fields
}

ReposAPI exposes the Repos API

func NewReposAPI

func NewReposAPI(ctx context.Context, m any) ReposAPI

NewReposAPI creates ReposAPI instance from provider meta

func (ReposAPI) Create

func (a ReposAPI) Create(r reposCreateRequest) (ReposInformation, error)

func (ReposAPI) Delete

func (a ReposAPI) Delete(id string) error

func (ReposAPI) List

func (a ReposAPI) List(prefix string) ([]ReposInformation, error)

func (ReposAPI) ListAll

func (a ReposAPI) ListAll() ([]ReposInformation, error)

func (ReposAPI) Read

func (a ReposAPI) Read(id string) (ReposInformation, error)

func (ReposAPI) Update

func (a ReposAPI) Update(id string, r map[string]any) error

type ReposInformation

type ReposInformation struct {
	ID             int64                `json:"id"`
	Url            string               `json:"url" tf:"force_new"`
	Provider       string               `json:"provider,omitempty" tf:"computed,alias:git_provider,force_new"`
	SparseCheckout *ReposSparseCheckout `json:"sparse_checkout,omitempty" tf:"force_new"`
	Path           string               `json:"path,omitempty" tf:"computed,force_new"` // TODO: remove force_new after the Update API will support changing the path
	Branch         string               `json:"branch,omitempty" tf:"computed"`
	HeadCommitID   string               `json:"head_commit_id,omitempty" tf:"computed,alias:commit_hash"`
}

ReposInformation provides information about given repository

func (ReposInformation) RepoID

func (r ReposInformation) RepoID() string

RepoID returns job id as string

type ReposListResponse

type ReposListResponse struct {
	NextPageToken string             `json:"next_page_token,omitempty"`
	Repos         []ReposInformation `json:"repos"`
}

type ReposSparseCheckout added in v1.8.0

type ReposSparseCheckout struct {
	Patterns []string `json:"patterns"`
}

Jump to

Keyboard shortcuts

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