github

package
v0.0.0-...-84373d0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailedUpdatingFile

func FailedUpdatingFile() errors.SlugError

func FileAccessDenied

func FileAccessDenied() errors.SlugError

func FileNotFound

func FileNotFound() errors.SlugError

func RefAlreadyExists

func RefAlreadyExists() errors.SlugError

func RefNotFound

func RefNotFound() errors.SlugError

func RepositoryAccessDenied

func RepositoryAccessDenied() errors.SlugError

func RepositoryNotFound

func RepositoryNotFound() errors.SlugError

func UnableToDecodeFileContent

func UnableToDecodeFileContent() errors.SlugError

func UnknownError

func UnknownError() errors.SlugError

Types

type Branch

type Branch struct {
	Name string
	SHA  string
}

func (Branch) Empty

func (b Branch) Empty() bool

func (Branch) Equal

func (b Branch) Equal(other Branch) bool

type ContentService

type ContentService interface {
	GetFile(ctx context.Context, repo Repository, path string) (*File, error)
	UpdateContent(ctx context.Context, repo Repository, branch string, file *File) error
}

type File

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

func LoadGitHubFile

func LoadGitHubFile(path, content, sourceSHA string) *File

func (*File) Content

func (f *File) Content() string

func (*File) Diff

func (f *File) Diff() string

func (*File) Modified

func (f *File) Modified() bool

func (*File) Modify

func (f *File) Modify(content string) *File

func (*File) Path

func (f *File) Path() string

func (*File) SourceSHA

func (f *File) SourceSHA() string

type PullRequest

type PullRequest struct {
	Number  int
	HTMLURL string
}

type PullRequestService

type PullRequestService interface {
	Create(ctx context.Context, repo Repository, targetBranch string, prTemplate PullRequestTemplate) (PullRequest, error)
	RequestReview(ctx context.Context, repo Repository, pr PullRequest, prTemplate PullRequestTemplate) error
}

type PullRequestTemplate

type PullRequestTemplate struct {
	Title         string
	Body          string
	Reviewers     []string
	TeamReviewers []string
}

type Repository

type Repository struct {
	Owner        string
	Name         string
	SourceBranch Branch
	TargetBranch Branch
}

func LoadRepository

func LoadRepository(owner, name, branchName string, branchSHA string) *Repository

type RepositoryService

type RepositoryService interface {
	GetRepository(ctx context.Context, owner, name, sourceBranch string) (*Repository, error)
	CreateBranchFromSourceBranch(ctx context.Context, repo *Repository, branchName string) error
}

Jump to

Keyboard shortcuts

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