attachments

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID           int64   `json:"id"`
	Name         string  `json:"name"`
	Size         int64   `json:"size"`
	ContentType  string  `json:"content_type"`
	Href         string  `json:"href"`
	OriginalName *string `json:"original_name"`
}

type RefererPage

type RefererPage struct {
	URL  string
	Meta refererPageMetadata
}

RefererPage carries the referer URL and the metadata parsed from its HTML at fetch time.

type RefererPageFetcher

type RefererPageFetcher interface {
	Fetch(ctx context.Context, client *web.Client) (*RefererPage, error)
}

func NewCommitHeadPageFetcher

func NewCommitHeadPageFetcher(host string, repoFullName string) RefererPageFetcher

func NewIssueNewPageFetcher

func NewIssueNewPageFetcher(host string, repoFullName string) RefererPageFetcher

type Uploader

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

Uploader carries the shared session context for GitHub user-attachment uploads.

func NewUploader

func NewUploader(host string, session browserprovider.BrowserSession, client *http.Client) (*Uploader, error)

func (*Uploader) ResolveRefererPage

func (u *Uploader) ResolveRefererPage(ctx context.Context, fetchers []RefererPageFetcher) (*RefererPage, error)

func (*Uploader) Upload

func (u *Uploader) Upload(ctx context.Context, filePath string, refererPage *RefererPage, repositoryID int64) (Asset, error)

Jump to

Keyboard shortcuts

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