Documentation
¶
Overview ¶
Package workflow orchestrates the APK publishing workflow.
Index ¶
- Variables
- func OutputEvents(events *nostr.EventSet)
- func OutputEventsToStdout(events *nostr.EventSet)
- func OutputUploadManifest(entries []UploadManifestEntry, blossomServer string)
- func ResolveURLsWithoutUpload(ctx context.Context, cfg *config.Config, apkInfo *apk.APKInfo, ...) (iconURL string, imageURLs []string, err error)
- func UploadAndSignWithBatch(ctx context.Context, params UploadParams) (*nostr.EventSet, error)
- func UploadWithIndividualSigning(ctx context.Context, params UploadParams) (iconURL string, imageURLs []string, err error)
- func WithSpinner[T any](opts *cli.Options, message string, fn func() (T, error)) (T, error)
- func WithSpinnerMsg(opts *cli.Options, message string, fn func() error, ...) error
- type DownloadedImage
- type PreDownloadedImages
- type Publisher
- type UploadManifestEntry
- type UploadParams
Constants ¶
This section is empty.
Variables ¶
var ErrNothingToDo = fmt.Errorf("nothing to do")
ErrNothingToDo indicates no publishing is needed.
Functions ¶
func OutputEvents ¶
OutputEvents prints events as formatted, colorized JSON.
func OutputEventsToStdout ¶ added in v0.3.1
OutputEventsToStdout outputs events as newline-delimited JSON to stdout. This format is suitable for piping to tools like `nak event`.
func OutputUploadManifest ¶ added in v0.3.1
func OutputUploadManifest(entries []UploadManifestEntry, blossomServer string)
OutputUploadManifest outputs the upload manifest to stderr.
func ResolveURLsWithoutUpload ¶
func ResolveURLsWithoutUpload(ctx context.Context, cfg *config.Config, apkInfo *apk.APKInfo, blossomURL string, preDownloaded *PreDownloadedImages, opts *cli.Options) (iconURL string, imageURLs []string, err error)
ResolveURLsWithoutUpload computes Blossom URLs by downloading/reading files and computing hashes, but without actually uploading to Blossom. Used for offline and npub modes.
func UploadAndSignWithBatch ¶
UploadAndSignWithBatch handles uploads and signing when using a batch signer.
func UploadWithIndividualSigning ¶
func UploadWithIndividualSigning(ctx context.Context, params UploadParams) (iconURL string, imageURLs []string, err error)
UploadWithIndividualSigning handles uploads with regular signers.
func WithSpinner ¶
WithSpinner executes a function with spinner feedback. Returns the result and any error from the function.
Types ¶
type DownloadedImage ¶
type DownloadedImage struct {
URL string // Original URL
Data []byte // Image bytes
Hash string // SHA256 hash (hex)
MimeType string // MIME type
}
DownloadedImage holds pre-downloaded image data.
type PreDownloadedImages ¶
type PreDownloadedImages struct {
Icon *DownloadedImage // Icon (from cfg.Icon if remote URL)
Images []*DownloadedImage // Screenshots (from cfg.Images if remote URLs)
}
PreDownloadedImages holds all pre-downloaded images for a release.
func PreDownloadImages ¶
func PreDownloadImages(ctx context.Context, cfg *config.Config, opts *cli.Options) (*PreDownloadedImages, error)
PreDownloadImages downloads cfg.Icon and cfg.Images if they are remote URLs.
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher orchestrates the APK publishing workflow.
func NewPublisher ¶
NewPublisher creates a new publish workflow.
type UploadManifestEntry ¶ added in v0.3.1
type UploadManifestEntry struct {
Description string // Human-readable description (e.g., "APK", "Icon", "Screenshot 1")
FilePath string // Local file path or "(from APK)" for extracted data
SHA256 string // SHA256 hash of the file
BlossomURL string // Expected Blossom URL
}
UploadManifestEntry represents a file that must be uploaded to Blossom.
type UploadParams ¶
type UploadParams struct {
Cfg *config.Config
APKInfo *apk.APKInfo
APKPath string
Release *source.Release
Client *blossom.Client
OriginalURL string
BlossomServer string
BatchSigner nostr.BatchSigner
Signer nostr.Signer
Pubkey string
RelayHint string
PreDownloaded *PreDownloadedImages
Variant string
Commit string
Channel string
Opts *cli.Options
AppCreatedAtRelease bool
MinReleaseTimestamp time.Time // Bump Release.CreatedAt above this (--overwrite-release)
}
UploadParams contains parameters for upload functions.