contentprovider

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const GitHubPrefix = "https://github.com/"
View Source
const GitLabPrefix = "https://gitlab.com/"
View Source
const LocalPathPrefix = "file://"

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

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

func NewGitHub

func NewGitHub(remoteURI string) (*GitHub, error)

func (*GitHub) Cleanup

func (cp *GitHub) Cleanup() error

func (*GitHub) DownloadContent

func (cp *GitHub) DownloadContent() error

func (*GitHub) RemoteURI

func (cp *GitHub) RemoteURI() string

func (*GitHub) WorkingDir

func (cp *GitHub) WorkingDir() string

type GitLab added in v0.0.11

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

func NewGitLab added in v0.0.11

func NewGitLab(remoteURI string, opt ...GitLabOption) (*GitLab, error)

func (*GitLab) Cleanup added in v0.0.11

func (cp *GitLab) Cleanup() error

func (*GitLab) DownloadContent added in v0.0.11

func (cp *GitLab) DownloadContent() error

func (*GitLab) RemoteURI added in v0.0.11

func (cp *GitLab) RemoteURI() string

func (*GitLab) WorkingDir added in v0.0.11

func (cp *GitLab) WorkingDir() string

type GitLabOption added in v0.0.12

type GitLabOption func(*GitLab)

func WithHTTPClient added in v0.0.12

func WithHTTPClient(httpClient *http.Client) GitLabOption

type LocalPath

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

func NewLocalPath

func NewLocalPath(path string) (*LocalPath, error)

func (*LocalPath) Cleanup

func (cp *LocalPath) Cleanup() error

func (*LocalPath) DownloadContent

func (cp *LocalPath) DownloadContent() error

func (*LocalPath) RemoteURI

func (cp *LocalPath) RemoteURI() string

func (*LocalPath) WorkingDir

func (cp *LocalPath) WorkingDir() string

type RemoteContentProvider

type RemoteContentProvider interface {
	// DownloadContent Download the remote content to a local working directory
	DownloadContent() error
	// Cleanup Perform the cleanup task for the provider
	Cleanup() error
	// WorkingDir Get the local working directory
	WorkingDir() string
	// RemoteURI Get the remote URI
	RemoteURI() string
}

func ByURI

func ByURI(uri string) (RemoteContentProvider, error)

Jump to

Keyboard shortcuts

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