bitbucket

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

README

DISCLAIMER

This is a very basic implementation of bitbucket v1 API client for our internal needs.

This library will be updated if the need arises.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Size          int           `json:"size"`
	Limit         int           `json:"limit"`
	IsLastPage    bool          `json:"isLastPage"`
	Start         int           `json:"start"`
	NextPageStart int           `json:"nextPageStart"`
	Values        []interface{} `json:"values"`
}

type Author

type Author struct {
	Name         string `json:"name"`
	EmailAddress string `json:"emailAddress"`
}

type BClientOptionsFunc added in v0.1.2

type BClientOptionsFunc func(*Client) error

func WithMaxConnections added in v0.1.3

func WithMaxConnections(maxCons int) BClientOptionsFunc

func WithMaxTimeoutWait added in v0.1.3

func WithMaxTimeoutWait(maxTimeout time.Duration) BClientOptionsFunc

type Branch added in v0.1.4

type Branch struct {
	Id              string `json:"id"`
	DisplayID       string `json:"displayId"`
	Type            string `json:"type"`
	LatestCommit    string `json:"latestCommit"`
	LatestChangeset string `json:"latestCahngeset`
	IsDefault       bool   `json:"isDefault"`
}

type Client

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

func New

func New(token, baseUrl string, options ...BClientOptionsFunc) *Client

func (*Client) GetProject

func (c *Client) GetProject(projectName string) (*Project, error)

func (*Client) GetProjectRepos

func (c *Client) GetProjectRepos(projectKey string, pagination *Pagination, filter *ProjectReposFilter) ([]*Repository, error)

func (*Client) GetProjectReposCommit added in v0.1.6

func (c *Client) GetProjectReposCommit(projectKey, repoSlug, commitId string) (*Commit, error)

func (*Client) GetProjectsReposBranches added in v0.1.4

func (c *Client) GetProjectsReposBranches(projectKey string, repoSlug string, pagination *Pagination, filter *ProjectReposBranchesFilter) ([]*Branch, error)

func (*Client) GetProjectsReposBranchesDefault added in v0.1.4

func (c *Client) GetProjectsReposBranchesDefault(projectKey string, repoSlug string, pagination *Pagination) (*Branch, error)

func (*Client) GetProjectsReposCommits

func (c *Client) GetProjectsReposCommits(projectKey string, repoSlug string, pagination *Pagination) ([]*Commit, error)

func (*Client) GetProjectsReposFileRaw

func (c *Client) GetProjectsReposFileRaw(projectKey string, repoSlug string, path string, filter *ProjectReposFileFilter) ([]byte, error)

func (*Client) GetProjectsReposFiles

func (c *Client) GetProjectsReposFiles(projectKey string, repoSlug string, pagination *Pagination, filter *ProjectReposFileFilter) ([]string, error)

func (*Client) ListProjects

func (c *Client) ListProjects(pagination *Pagination, filter *ProjectsFilter) ([]*Project, error)

type ClientError

type ClientError struct {
	Message       string `json:"message"`
	Context       string `json:"context"`
	ExceptionName string `json:"exceptionName"`
}

type Commit

type Commit struct {
	Id                 string     `json:"id"`
	DisplayId          string     `json:"displayId"`
	Author             Author     `json:"author"`
	AuthorTimestamp    CommitTime `json:"authorTimestamp"`
	Committer          Committer  `json:"committer"`
	CommitterTimestamp CommitTime `json:"committerTimestamp"`
	Message            string     `json:"message"`
	Parents            []Parent   `json:"parents"`
}

type CommitTime

type CommitTime time.Time

func (CommitTime) MarshalJSON

func (t CommitTime) MarshalJSON() ([]byte, error)

func (CommitTime) String

func (t CommitTime) String() string

func (CommitTime) Time

func (t CommitTime) Time() time.Time

func (CommitTime) Unix

func (t CommitTime) Unix() int64

func (*CommitTime) UnmarshalJSON

func (t *CommitTime) UnmarshalJSON(s []byte) (err error)

type Committer

type Committer struct {
	Name         string `json:"name"`
	EmailAddress string `json:"emailAddress"`
}

type Errors

type Errors struct {
	StatusCode int           `json:"-"`
	Errors     []ClientError `json:"errors"`
}

func (Errors) Error

func (e Errors) Error() string
type Links struct {
	Href string `json:"href,omitempty"`
	Name string `json:"name,omitempty"`
}

type Pagination

type Pagination struct {
	Size          int  `json:"size"`
	Limit         int  `json:"limit"`
	IsLastPage    bool `json:"isLastPage"`
	Start         int  `json:"start"`
	NextPageStart int  `json:"nextPageStart"`
}

func DefaultPagination

func DefaultPagination() *Pagination

type Parent

type Parent struct {
	Id        string `json:"id"`
	DisplayId string `json:"displayId"`
}

type Project

type Project struct {
	Key         string       `json:"key"`
	Id          int          `json:"id"`
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Public      bool         `json:"public"`
	Type        string       `json:"type"`
	Links       ProjectLinks `json:"links,omitempty"`
}
type ProjectLinks struct {
	Self  []Links `json:"self,omitempty"`
	Clone []Links `json:"clone,omitempty"`
}

type ProjectReposBranchesFilter added in v0.1.4

type ProjectReposBranchesFilter struct {
	Base    string `structs:"base"`
	Details bool   `structs:"details"`
	Text    string `structs:"filterText"`
	OrderBy string `structs:"orderBy"`
}

type ProjectReposFileFilter

type ProjectReposFileFilter struct {
	At string `structs:"at"`
}

type ProjectReposFilter

type ProjectReposFilter struct {
	ProjectKey string `structs:"projectKey"`
}

type Projects

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

type ProjectsFilter

type ProjectsFilter struct {
	Name       string
	Permission string
}

type Repository

type Repository struct {
	Slug          string       `json:"slug"`
	Id            int          `json:"id"`
	Name          string       `json:"name"`
	ScmId         string       `json:"scmId"`
	State         string       `json:"state"`
	StatusMessage string       `json:"statusMessage"`
	Forkable      bool         `json:"forkable"`
	Project       Project      `json:"project"`
	Public        bool         `json:"public"`
	Links         ProjectLinks `json:"links"`
}

type Response

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

Jump to

Keyboard shortcuts

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