vcs

package
v0.0.0-...-d116552 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BitbucketMaxCommentLength = 32768
	BitbucketDefaultBaseURL   = "https://api.bitbucket.org/2.0/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitbucketClient

type BitbucketClient struct {
	*http.Client
	BaseURL   *url.URL
	UserAgent string
}

func (*BitbucketClient) Do

func (c *BitbucketClient) Do(ctx context.Context, req *http.Request, v any) (*http.Response, error)

func (*BitbucketClient) NewRequest

func (c *BitbucketClient) NewRequest(method string, url string, body any) (*http.Request, error)

type BitbucketComment

type BitbucketComment struct {
	Content *BitbucketContent `json:"content,omitempty"`
	Id      *int64            `json:"id,omitempty"`
	Links   *BitbucketLinks   `json:"links,omitempty"`
}

type BitbucketComments

type BitbucketComments struct {
	Values []BitbucketComment `json:"values,omitempty"`
}

type BitbucketContent

type BitbucketContent struct {
	Raw string `json:"raw,omitempty"`
}

type BitbucketHtml

type BitbucketHtml struct {
	Href string `json:"href,omitempty"`
}
type BitbucketLinks struct {
	Html BitbucketHtml `json:"html,omitempty"`
}

type BitbucketProvider

type BitbucketProvider struct {
	*BitbucketClient
	// contains filtered or unexported fields
}

func NewBitbucketProvider

func NewBitbucketProvider(config config.Config) *BitbucketProvider

func (BitbucketProvider) CreateComment

func (b BitbucketProvider) CreateComment(ctx context.Context, content string) (*Comment, error)

func (BitbucketProvider) DeleteComment

func (b BitbucketProvider) DeleteComment(ctx context.Context, id int64) error

func (BitbucketProvider) ListComments

func (b BitbucketProvider) ListComments(ctx context.Context) ([]Comment, error)

func (BitbucketProvider) MaxCommentSize

func (b BitbucketProvider) MaxCommentSize() int

func (BitbucketProvider) UpdateComment

func (b BitbucketProvider) UpdateComment(ctx context.Context, id int64, content string) (*Comment, error)

type Comment

type Comment struct {
	Id   int64
	Body string
	Link string
}

type Provider

type Provider interface {
	CreateComment(ctx context.Context, content string) (*Comment, error)
	UpdateComment(ctx context.Context, id int64, content string) (*Comment, error)
	DeleteComment(ctx context.Context, id int64) error
	ListComments(ctx context.Context) ([]Comment, error)
	MaxCommentSize() int
}

Provider interface for public methods actions required for handling PullRequest comments

func CreateProvider

func CreateProvider(c config.Config) (Provider, error)

Jump to

Keyboard shortcuts

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