snips

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileTypeBinary   = "binary"
	FileTypeMarkdown = "markdown"
)

Variables

This section is empty.

Functions

func IsZSTDCompressed added in v0.10.0

func IsZSTDCompressed(data []byte) bool

IsZSTDCompressed checks if the data starts with the zstd magic number. https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#zstandard-frames

Types

type File

type File struct {
	ID         string
	CreatedAt  time.Time
	UpdatedAt  time.Time
	Size       uint64
	RawContent []byte
	Private    bool
	Type       string
	UserID     string
}

func (*File) GetContent added in v0.3.0

func (f *File) GetContent() ([]byte, error)

func (*File) GetSignedURL

func (f *File) GetSignedURL(cfg *config.Config, ttl time.Duration) (url.URL, time.Time)

func (*File) IsBinary

func (f *File) IsBinary() bool

func (*File) IsMarkdown

func (f *File) IsMarkdown() bool

func (*File) SetContent added in v0.3.0

func (f *File) SetContent(in []byte, compress bool) error

func (*File) Visibility

func (f *File) Visibility() string

type PublicKey

type PublicKey struct {
	ID          string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Fingerprint string
	Type        string
	UserID      string
}

type Revision added in v0.10.0

type Revision struct {
	ID        string
	Sequence  int64
	FileID    string
	CreatedAt time.Time
	RawDiff   []byte // may be zstd-compressed
	Size      uint64 // file size after this revision
	Type      string // file type after this revision
}

func (*Revision) GetDiff added in v0.10.0

func (r *Revision) GetDiff() ([]byte, error)

func (*Revision) SetDiff added in v0.10.0

func (r *Revision) SetDiff(in []byte, compress bool) error

type User

type User struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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