lib

package
v1.0.57 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadDirectory added in v1.0.54

func DownloadDirectory(ctx context.Context, scmType SCMType, baseURL, owner, repo, path, destDir string) error

func GetRepositories

func GetRepositories(ctx context.Context, scmType SCMType, baseURL, owner string) ([]string, error)

Types

type Catalog added in v1.0.54

type Catalog struct {
	Catalog struct {
		Name        string `toml:"name"`
		Description string `toml:"description"`
		Version     string `toml:"version"`
		LastUpdated struct {
			Date       string `toml:"date"`
			CommitHash string `toml:"commit_hash"`
		} `toml:"last_updated"`
	} `toml:"catalog"`
	Plugins   map[string]Plugin   `toml:"plugins"`
	Templates map[string]Template `toml:"templates"`
}

func FetchGitspaceCatalog

func FetchGitspaceCatalog(ctx context.Context, scmType SCMType, baseURL, owner, repo string) (*Catalog, error)

type GitHubProvider added in v1.0.54

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

func NewGitHubProvider added in v1.0.54

func NewGitHubProvider() (*GitHubProvider, error)

func (*GitHubProvider) DownloadDirectory added in v1.0.54

func (g *GitHubProvider) DownloadDirectory(ctx context.Context, owner, repo, path, destDir string) error

func (*GitHubProvider) FetchCatalog added in v1.0.54

func (g *GitHubProvider) FetchCatalog(ctx context.Context, owner, repo string) (*Catalog, error)

func (*GitHubProvider) FetchRepositories added in v1.0.54

func (g *GitHubProvider) FetchRepositories(ctx context.Context, owner string) ([]string, error)

func (*GitHubProvider) GetLatestRelease added in v1.0.54

func (g *GitHubProvider) GetLatestRelease(ctx context.Context, owner, repo string) (*Release, error)

type GiteaProvider added in v1.0.54

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

func NewGiteaProvider added in v1.0.54

func NewGiteaProvider(baseURL string) (*GiteaProvider, error)

func (*GiteaProvider) DownloadDirectory added in v1.0.54

func (g *GiteaProvider) DownloadDirectory(ctx context.Context, owner, repo, path, destDir string) error

func (*GiteaProvider) FetchCatalog added in v1.0.54

func (g *GiteaProvider) FetchCatalog(ctx context.Context, owner, repo string) (*Catalog, error)

func (*GiteaProvider) FetchRepositories added in v1.0.54

func (g *GiteaProvider) FetchRepositories(ctx context.Context, owner string) ([]string, error)

func (*GiteaProvider) GetLatestRelease added in v1.0.54

func (g *GiteaProvider) GetLatestRelease(ctx context.Context, owner, repo string) (*Release, error)

type Plugin

type Plugin struct {
	Version     string `toml:"version"`
	Description string `toml:"description"`
	Path        string `toml:"path"`
	Repository  struct {
		Type string `toml:"type"`
		URL  string `toml:"url"`
	} `toml:"repository"`
}

type Release added in v1.0.54

type Release struct {
	TagName     string    `json:"tag_name"`
	PublishedAt time.Time `json:"published_at"`
	Body        string    `json:"body"`
}

func GetLatestRelease added in v1.0.54

func GetLatestRelease(ctx context.Context, scmType SCMType, baseURL, owner, repo string) (*Release, error)

type SCMProvider added in v1.0.54

type SCMProvider interface {
	GetLatestRelease(ctx context.Context, owner, repo string) (*Release, error)
	FetchRepositories(ctx context.Context, owner string) ([]string, error)
	FetchCatalog(ctx context.Context, owner, repo string) (*Catalog, error)
	DownloadDirectory(ctx context.Context, owner, repo, path, destDir string) error
}

func GetSCMProvider added in v1.0.54

func GetSCMProvider(scmType SCMType, baseURL string) (SCMProvider, error)

type SCMType added in v1.0.54

type SCMType string
const (
	SCMTypeGitHub SCMType = "github"
	SCMTypeGitea  SCMType = "gitea"
)

type Template

type Template struct {
	Version     string `toml:"version,omitempty"`
	Description string `toml:"description,omitempty"`
	Path        string `toml:"path"`
	Repository  struct {
		Type string `toml:"type"`
		URL  string `toml:"url"`
	} `toml:"repository"`
}

Jump to

Keyboard shortcuts

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