Documentation
¶
Index ¶
- Constants
- Variables
- func IsZSTDCompressed(data []byte) bool
- func NormalizeName(name string) (string, error)
- type File
- func (f *File) DisplayName() string
- func (f *File) GetContent() ([]byte, error)
- func (f *File) GetSignedURL(cfg *config.Config, ttl time.Duration) (url.URL, time.Time)
- func (f *File) IsBinary() bool
- func (f *File) IsMarkdown() bool
- func (f *File) SetContent(in []byte, compress bool) error
- func (f *File) Visibility() string
- type PublicKey
- type Revision
- type User
Constants ¶
View Source
const ( FileTypeBinary = "binary" FileTypeMarkdown = "markdown" )
View Source
const (
// NameMaxLength is the maximum length of a file's name.
NameMaxLength = 40
)
Variables ¶
View Source
var (
ErrInvalidName = fmt.Errorf("names must be 1-%d alphanumeric characters (hyphen, dot, or underscore separators allowed)", NameMaxLength)
)
Functions ¶
func IsZSTDCompressed ¶ added in v0.10.0
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
func NormalizeName ¶ added in v0.12.0
Types ¶
type File ¶
type File struct {
ID string
CreatedAt time.Time
UpdatedAt time.Time
Size uint64
RawContent []byte
Private bool
Type string
UserID string
Name string
}
func (*File) DisplayName ¶ added in v0.12.0
func (*File) GetContent ¶ added in v0.3.0
func (*File) GetSignedURL ¶
func (*File) IsMarkdown ¶
func (*File) Visibility ¶
Click to show internal directories.
Click to hide internal directories.