repository

package
v1.13.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 18 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdoptRepository added in v1.13.0

func AdoptRepository(doer, owner *models.User, opts models.CreateRepoOptions) (*models.Repository, error)

AdoptRepository adopts pre-existing repository files for the user/organization.

func ChangeRepositoryName

func ChangeRepositoryName(doer *models.User, repo *models.Repository, newRepoName string) error

ChangeRepositoryName changes all corresponding setting from old repository name to new one.

func CreateRepository

func CreateRepository(doer, owner *models.User, opts models.CreateRepoOptions) (*models.Repository, error)

CreateRepository creates a repository for the user/organization.

func DeleteRepository

func DeleteRepository(doer *models.User, repo *models.Repository) error

DeleteRepository deletes a repository for a user or organization.

func DeleteUnadoptedRepository added in v1.13.0

func DeleteUnadoptedRepository(doer, owner *models.User, name string) error

DeleteUnadoptedRepository adopts pre-existing repository files for the user/organization.

func ForkRepository

func ForkRepository(doer, u *models.User, oldRepo *models.Repository, name, desc string) (*models.Repository, error)

ForkRepository forks a repository

func GenerateRepository

func GenerateRepository(doer, owner *models.User, templateRepo *models.Repository, opts models.GenerateRepoOptions) (_ *models.Repository, err error)

GenerateRepository generates a repository from a template

func NewContext added in v1.13.0

func NewContext() error

NewContext start repository service

func PushCreateRepo

func PushCreateRepo(authUser, owner *models.User, repoName string) (*models.Repository, error)

PushCreateRepo creates a repository when a new repository is pushed to an appropriate namespace

func PushUpdate added in v1.13.0

func PushUpdate(opts *PushUpdateOptions) error

PushUpdate is an alias of PushUpdates for single push update options

func PushUpdates added in v1.13.0

func PushUpdates(opts []*PushUpdateOptions) error

PushUpdates adds a push update to push queue

func StartRepositoryTransfer added in v1.13.3

func StartRepositoryTransfer(doer, newOwner *models.User, repo *models.Repository, teams []*models.Team) error

StartRepositoryTransfer transfer a repo from one owner to a new one. it make repository into pending transfer state, if doer can not create repo for new owner.

func TransferOwnership

func TransferOwnership(doer, newOwner *models.User, repo *models.Repository, teams []*models.Team) error

TransferOwnership transfers all corresponding setting from old user to new one.

Types

type PushUpdateOptions added in v1.13.0

type PushUpdateOptions struct {
	PusherID     int64
	PusherName   string
	RepoUserName string
	RepoName     string
	RefFullName  string // branch, tag or other name to push
	OldCommitID  string
	NewCommitID  string
}

PushUpdateOptions defines the push update options

func (PushUpdateOptions) BranchName added in v1.13.0

func (opts PushUpdateOptions) BranchName() string

BranchName returns simple branch name if it's an operation to branch

func (PushUpdateOptions) IsBranch added in v1.13.0

func (opts PushUpdateOptions) IsBranch() bool

IsBranch return true if it's a push to branch

func (PushUpdateOptions) IsDelBranch added in v1.13.0

func (opts PushUpdateOptions) IsDelBranch() bool

IsDelBranch return true if it's a deletion to a branch

func (PushUpdateOptions) IsDelRef added in v1.13.0

func (opts PushUpdateOptions) IsDelRef() bool

IsDelRef return true if it's a deletion to a branch or tag

func (PushUpdateOptions) IsDelTag added in v1.13.0

func (opts PushUpdateOptions) IsDelTag() bool

IsDelTag return true if it's a deletion to a tag

func (PushUpdateOptions) IsNewBranch added in v1.13.0

func (opts PushUpdateOptions) IsNewBranch() bool

IsNewBranch return true if it's the first-time push to a branch

func (PushUpdateOptions) IsNewRef added in v1.13.0

func (opts PushUpdateOptions) IsNewRef() bool

IsNewRef return true if it's a first-time push to a branch, tag or etc.

func (PushUpdateOptions) IsNewTag added in v1.13.0

func (opts PushUpdateOptions) IsNewTag() bool

IsNewTag return true if it's a creation to a tag

func (PushUpdateOptions) IsTag added in v1.13.0

func (opts PushUpdateOptions) IsTag() bool

IsTag return true if it's an operation to a tag

func (PushUpdateOptions) IsUpdateBranch added in v1.13.0

func (opts PushUpdateOptions) IsUpdateBranch() bool

IsUpdateBranch return true if it's not the first push to a branch

func (PushUpdateOptions) IsUpdateRef added in v1.13.0

func (opts PushUpdateOptions) IsUpdateRef() bool

IsUpdateRef return true if it's an update operation

func (PushUpdateOptions) RefName added in v1.13.0

func (opts PushUpdateOptions) RefName() string

RefName returns simple name for ref

func (PushUpdateOptions) RepoFullName added in v1.13.0

func (opts PushUpdateOptions) RepoFullName() string

RepoFullName returns repo full name

func (PushUpdateOptions) TagName added in v1.13.0

func (opts PushUpdateOptions) TagName() string

TagName returns simple tag name if it's an operation to a tag

Jump to

Keyboard shortcuts

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