app

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieResolver

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

CookieResolver finds the first browser session whose dotcom_user matches a GitHub login.

func NewCookieResolver

func NewCookieResolver(
	providers map[cookies.Browser]browserprovider.BrowserProvider,
	verbose bool,
	stderr io.Writer,
) *CookieResolver

func (*CookieResolver) Resolve

func (r *CookieResolver) Resolve(ctx context.Context, host, ghLogin string, sources []cookies.Source) (ResolvedCookies, error)

Resolve expands "auto" sources and returns the first session matching ghLogin via dotcom_user.

type DownloadRequest added in v0.4.2

type DownloadRequest struct {
	URL             string
	Browser         string
	Profile         string
	CookieStorePath string
	SessionToken    string
	Verbose         bool
}

type LoginResolver

type LoginResolver interface {
	Login(host string) (string, error)
}

LoginResolver resolves the login the upload acts as, used to pick the matching cookie container.

func NewConfigLoginResolver

func NewConfigLoginResolver(api apiLoginResolver) LoginResolver

type RepositoryIDResolver

type RepositoryIDResolver interface {
	RepositoryID(refererPage *attachments.RefererPage, owner string, name string) (int64, error)
}

RepositoryIDResolver resolves the numeric repository_id the upload API needs.

func NewPageRepositoryIDResolver

func NewPageRepositoryIDResolver(api apiRepositoryResolver) RepositoryIDResolver

type Request

type Request struct {
	FilePaths       []string
	Repo            string
	Browser         string
	Profile         string
	CookieStorePath string
	SessionToken    string
	Verbose         bool
}

type ResolvedCookies

type ResolvedCookies struct {
	Session      browserprovider.BrowserSession
	Source       cookies.Source
	ProviderName string
}

type Service

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

Service orchestrates GitHub user-attachment flows.

func NewService

func NewService(stderr io.Writer) *Service

func (*Service) Download added in v0.4.2

func (s *Service) Download(ctx context.Context, req DownloadRequest) (io.ReadCloser, error)

func (*Service) Run

func (s *Service) Run(ctx context.Context, req Request) ([]attachments.Asset, error)

type SessionResolver

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

SessionResolver hides the login-then-cookie-match coupling behind a single "give me a session" call.

func NewSessionResolver

func NewSessionResolver(logins LoginResolver, cookies *CookieResolver) *SessionResolver

func (*SessionResolver) Resolve

func (s *SessionResolver) Resolve(ctx context.Context, host string, sources []cookies.Source) (ResolvedCookies, error)

Jump to

Keyboard shortcuts

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