hosting

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Name   string  `json:"name"`
	Commit *Commit `json:"commit,omitempty"`
}

type Commit

type Commit struct {
	SHA       string        `json:"sha"`
	Tree      *CommitTree   `json:"tree,omitempty"`
	Author    *CommitAuthor `json:"author,omitempty"`
	Committer *CommitAuthor `json:"committer,omitempty"`
	Message   *string       `json:"message,omitempty"`
	Date      *time.Time    `json:"date,omitempty"`
}

type CommitAuthor

type CommitAuthor struct {
	Date  time.Time `json:"date"`
	Name  string    `json:"name"`
	Email string    `json:"email"`
}

type CommitTree added in v0.1.0

type CommitTree struct {
	SHA string `json:"sha"`
}

type CreateBranchOpts added in v0.1.0

type CreateBranchOpts struct {
	Ref    *string `json:"ref,omitempty"`
	SHA    *string `json:"sha,omitempty"`
	Branch *string `json:"branch,omitempty"`
}

type CreateFileOpts added in v0.1.0

type CreateFileOpts struct {
	SHA    *string `json:"sha"`
	Branch *string `json:"branch"`
	Ref    *string `json:"ref"`
	Commit `json:"commit"`
}

type DeleteFileOpts added in v0.1.0

type DeleteFileOpts struct {
	SHA    *string `json:"sha"`
	Branch *string `json:"branch"`
	Ref    *string `json:"ref"`
	Commit `json:"commit"`
}

type Encoding added in v0.1.0

type Encoding string
const (
	TextEncoding   Encoding = "text"
	Base64Encoding Encoding = "base64"
	NoneEncoding   Encoding = "none"
)

type File

type File struct {
	ID       string    `json:"id"`
	Type     string    `json:"type"`
	Content  *string   `json:"content,omitempty"`
	Encoding *Encoding `json:"encoding,omitempty"`
	Size     *int      `json:"size,omitempty"`
	Name     string    `json:"name"`
	Path     string    `json:"path"`
}

func (*File) GetEncoding added in v0.1.0

func (f *File) GetEncoding() *string

func (*File) SetEncoding added in v0.1.0

func (f *File) SetEncoding(encoding string) (*File, error)

type GetCommitsOpts added in v0.1.0

type GetCommitsOpts struct {
	Ref *string `json:"ref,omitempty"`
}

type GetFileOpts added in v0.1.0

type GetFileOpts struct {
	Ref *string `json:"ref"`
}

type GitHostingService added in v0.1.2

type GitHostingService interface {
	GetRepositories(ctx context.Context, owner string) ([]Repository, error)
	GetRepository(ctx context.Context, owner string, repo string) (*Repository, error)
	GetBranches(ctx context.Context, repo *Repository) ([]Branch, error)
	CreateBranch(ctx context.Context, repo *Repository, opts *CreateBranchOpts) (*Branch, error)
	DeleteBranch(ctx context.Context, repo *Repository, branch *Branch) error
	GetCommits(ctx context.Context, repo *Repository, opts *GetCommitsOpts) ([]Commit, error)
	GetFiles(ctx context.Context, repo *Repository, path string) (*File, []File, error)
	GetRawFile(ctx context.Context, repo *Repository, path string, opts *GetFileOpts) ([]byte, error)
	CreateFile(ctx context.Context, repo *Repository, file *File, opts *CreateFileOpts) (*File, *Commit, error)
	UpdateFile(ctx context.Context, repo *Repository, file *File, opts *UpdateFileOpts) (*File, *Commit, error)
	DeleteFile(ctx context.Context, repo *Repository, path string, opts *DeleteFileOpts) (*Commit, error)
}

type Repository

type Repository struct {
	Owner         string    `json:"owner"`
	Name          string    `json:"name"`
	DefaultBranch string    `json:"default_branch"`
	CloneURL      string    `json:"clone_url"`
	GitURL        string    `json:"git_url"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

type UpdateFileOpts added in v0.1.0

type UpdateFileOpts struct {
	SHA    *string `json:"sha"`
	Branch *string `json:"branch"`
	Ref    *string `json:"ref"`
	Commit `json:"commit"`
}

Jump to

Keyboard shortcuts

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