bitbucketapi

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_HOST string = "bitbucket.org"
)

Variables

This section is empty.

Functions

Types

type BitBucketAPI

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

func NewBitBucketAPI

func NewBitBucketAPI() *BitBucketAPI

func (*BitBucketAPI) GetDefaultBranchName

func (gl *BitBucketAPI) GetDefaultBranchName(owner, repo string, headers *Headers) (string, error)

func (*BitBucketAPI) GetLatestCommit

func (gl *BitBucketAPI) GetLatestCommit(owner, repo, branch string, headers *Headers) (*Commit, error)

func (*BitBucketAPI) GetRepoTree

func (gl *BitBucketAPI) GetRepoTree(owner, repo, branch string, headers *Headers) (*Tree, error)

type Commit

type Commit struct {
	Type   string    `json:"type"`
	Hash   string    `json:"hash"`
	Date   time.Time `json:"date"`
	Author struct {
		Type string `json:"type"`
		Raw  string `json:"raw"`
	} `json:"author"`
	Message string `json:"message"`
}

type Commits

type Commits struct {
	Values  []Commit `json:"values"`
	Pagelen int      `json:"pagelen"`
	Next    string   `json:"next"`
}

type Headers

type Headers struct {
	Token string
}

func (*Headers) ToMap

func (h *Headers) ToMap() map[string]string

ToMap convert headers to map[string]string

type IBitBucketAPI

type IBitBucketAPI interface {
	GetRepoTree(owner, repo, branch string, headers *Headers) (*Tree, error)
	GetDefaultBranchName(owner, repo string, headers *Headers) (string, error)
	GetLatestCommit(owner, repo, branch string, headers *Headers) (*Commit, error)
}

type ObjectType

type ObjectType string

type Tree

type Tree struct{}

Jump to

Keyboard shortcuts

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