branch

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateConfig = &request.Config{
	Action:   "POST",
	Resource: "projects/:project_id/repository/branches",
}
View Source
var DeleteConfig = &request.Config{
	Action:   "DELETE",
	Resource: "projects/:project_id/repository/branches/:branch_name",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}
View Source
var GetConfig = &request.Config{
	Action:   "GET",
	Resource: "projects/:project_id/repository/branches/:branch_name",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}
View Source
var ListConfig = &request.Config{
	Action:   "GET",
	Resource: "projects/:project_id/repository/branches",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}

Functions

func Delete

func Delete(client client.Client, req *DeleteRequest) error

Types

type Branch

type Branch struct {

	//
	Name               string `json:"name"`
	WebURL             string `json:"web_url"`
	CanPush            bool   `json:"can_push"`
	IsDefault          bool   `json:"default"`
	IsProtected        bool   `json:"protected"`
	IsMerged           bool   `json:"merged"`
	DevelopersCanPush  bool   `json:"developers_can_push"`
	DevelopersCanMerge bool   `json:"developers_can_merge"`
	//
	Commit Commit `json:"commit"`
	// contains filtered or unexported fields
}

func (*Branch) Create

func (r *Branch) Create(req *CreateRequest) (*Branch, error)

func (*Branch) Delete

func (r *Branch) Delete(req *DeleteRequest) error

func (*Branch) Get

func (r *Branch) Get(req *GetRequest) (*Branch, error)

func (*Branch) List added in v0.0.4

func (r *Branch) List(req *ListRequest) (*[]Branch, error)

type BranchImpl

type BranchImpl interface {
	List(req *ListRequest) (*[]Branch, error)
	Create(req *CreateRequest) (*Branch, error)
	Get(req *GetRequest) (*Branch, error)
	Delete(req *DeleteRequest) error
}

func New

func New(client client.Client) BranchImpl

type Commit

type Commit struct {
	ID             string    `json:"id"`
	ShortID        string    `json:"short_id"`
	Title          string    `json:"title"`
	Author         string    `json:"author_name"`
	Message        string    `json:"message"`
	AuthorEmail    string    `json:"author_email"`
	AuthoredDate   time.Time `json:"authored_date"`
	Committer      string    `json:"committer_name"`
	CommitterEmail string    `json:"committer_email"`
	CommittedDate  time.Time `json:"committed_date"`
	WebURL         string    `json:"web_url"`
	CreatedAt      time.Time `json:"created_at"`
	ParentIDs      []string  `json:"parent_ids"`
}

type CreateRequest

type CreateRequest struct {
	// the id of the project
	RepositoryID int64  `json:"repostory_id"`
	Name         string `json:"name"`

	// the name of the project
	RepositoryName string `json:"repository_name"`
	Ref            string `json:"ref"`
}

type CreateResponse

type CreateResponse = Branch

func Create

func Create(client client.Client, req *CreateRequest) (*CreateResponse, error)

type DeleteRequest

type DeleteRequest struct {
	// the id of the project
	RepositoryID int64  `json:"repository_id"`
	Name         string `json:"branch_name"`

	// the name of the project
	RepositoryName string `json:"repository_name"`
}

type GetRequest

type GetRequest struct {
	// the id of the project
	RepositoryID int64  `json:"repository_id"`
	Name         string `json:"branch_name"`

	// the name of the project
	RepositoryName string `json:"repository_name"`
}

type GetResponse

type GetResponse = Branch

func Get

func Get(client client.Client, req *GetRequest) (*GetResponse, error)

type ListRequest added in v0.0.4

type ListRequest struct {
	// the id of the project
	RepositoryID int64 `json:"repository_id"`
	// the name of the project
	RepositoryName string `json:"repository_name"`
}

type ListResponse added in v0.0.4

type ListResponse = []Branch

func List added in v0.0.4

func List(client client.Client, req *ListRequest) (*ListResponse, error)

Jump to

Keyboard shortcuts

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