beauties

package module
v0.0.0-...-e27e7f5 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 7 Imported by: 0

README

Description

Beauties is just a random name picked by @goberghen at 1493325888.

It refers to a beauty of the Internet, which allows us to share information.

Help

Beauties server index page

make help

Build

make

Develop

make deps

Debian package

For now /usr/bin/dh_systemd_enable must be patched with misc/dh_systemd_update.patch to build package properly. There is a bug #841746 with the original patch to address this problem.

make deb

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(number int64) (result string)

Encode encodes a symbol using symbol base Taken from https://github.com/fs111/kurz.go/blob/master/src/codec.go

Types

type File

type File interface {
	io.Reader
	io.Seeker
	io.Closer
}

File is a File interface combining io.Reader, io.Seeker and io.Closer

type LocalStorage

type LocalStorage struct {
	Storage
	Name string
	// contains filtered or unexported fields
}

LocalStorage is an implementation of a Storage interface using local directory to store files

func NewLocalStorage

func NewLocalStorage(basedir string) (storage *LocalStorage, err error)

NewLocalStorage returns a LocalStorage instance

func (*LocalStorage) Delete

func (s *LocalStorage) Delete(token, filename string) (err error)

Delete deletes file from a storage

func (*LocalStorage) Get

func (s *LocalStorage) Get(token string, filename string) (reader File, contentType string, contentLength int64, err error)

Get retrieves file from a storage

func (*LocalStorage) Head

func (s *LocalStorage) Head(token string, filename string) (contentType string, contentLength int64, err error)

Head returns content type and content length to use in e.g. HTTP HEAD method

func (*LocalStorage) IsNotExist

func (s *LocalStorage) IsNotExist(err error) bool

IsNotExist checks whether error meaning is file doesn't exists

func (*LocalStorage) Put

func (s *LocalStorage) Put(token string, filename string, reader io.Reader, contentLength int64) error

Put puts file in a storage

func (*LocalStorage) String

func (s *LocalStorage) String() string

String returns a string representation of LocalStorage

type Storage

type Storage interface {
	String() string
	Get(token, filename string) (reader File, contentType string, contentLength int64, err error)
	Head(token, filename string) (contentType string, contentLength int64, err error)
	Put(token, filename string, reader io.Reader, contentLength int64) error
	Delete(token, filename string) (err error)
	IsNotExist(err error) bool
}

Storage is a Storage interface

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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