projecticon

package
v0.1.53 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 15 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

Overview

Package projecticon stores and reads small images through a confined project root.

Index

Constants

View Source
const MaxBytes = 1 << 20
View Source
const Version = 2

Variables

View Source
var ErrInvalid = errors.New("invalid project icon")

Functions

func ValidatePath

func ValidatePath(name string) error

Types

type Image

type Image struct {
	Path      string `json:"path"`
	MediaType string `json:"mediaType"`
	Content   []byte `json:"content"` // JSON base64; never a public file URL.
	ETag      string `json:"etag"`
}

func Read

func Read(directory, name string) (Image, error)

func Upload

func Upload(directory, name string, data []byte) (Image, error)

Upload never uses a client-supplied storage path. Identical images reuse the same content-addressed file; a temporary file makes publication atomic. The caller saves the returned path through the usual revisioned project edit.

Jump to

Keyboard shortcuts

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