attachments

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrewarmUploadHostDNS added in v0.4.3

func PrewarmUploadHostDNS(ctx context.Context, host string)

PrewarmUploadHostDNS resolves upload-host DNS in the background, DNS-only.

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 web.Session, 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