cabri

package
v0.0.0-...-8a3b07d Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT"

Variables

View Source
var ActiveRootDir string
View Source
var ServerConfigMap = map[string]ServerConfig{
	"S3Read": {
		GetContentFunc:  S3GetContent,
		StatContentFunc: S3StatContent,
		StatDirFunc:     NotImplementedFunc,
		ListFunc:        S3List,
		PutContentFunc:  NotImplementedFunc,
		MkdirFunc:       NotImplementedFunc,
	},
	"FSWrite": {
		GetContentFunc:  FSGetContent,
		StatContentFunc: FSStatContent,
		StatDirFunc:     FSStatDir,
		ListFunc:        FSList,
		PutContentFunc:  FSPutContent,
		MkdirFunc:       FSMkdir,
	},
}

Functions

func Error

func Error(c *gin.Context, msg string, err error, status int)

func FSGetContent

func FSGetContent(c *gin.Context)

func FSList

func FSList(c *gin.Context)

func FSMkdir

func FSMkdir(c *gin.Context)

func FSPutContent

func FSPutContent(c *gin.Context)

func FSStatContent

func FSStatContent(c *gin.Context)

func FSStatDir

func FSStatDir(c *gin.Context)

func GetChecksum

func GetChecksum(checksum string, path string) (cs string, err error)

func GetContentError

func GetContentError(c *gin.Context, path string, err error, status int)

func ListError

func ListError(c *gin.Context, path string, err error, status int)

func MkdirError

func MkdirError(c *gin.Context, path string, err error, status int)

func NotImplementedFunc

func NotImplementedFunc(c *gin.Context)

func PutContentError

func PutContentError(c *gin.Context, path string, err error, status int)

func Run

func Run(engine *gin.Engine, addr string, configName string, rscRoot string, rootDir string)

func S3GetContent

func S3GetContent(c *gin.Context)

func S3List

func S3List(c *gin.Context)

func S3StatContent

func S3StatContent(c *gin.Context)

func SetLastModified

func SetLastModified(w http.ResponseWriter, modtime time.Time)

func StatContentError

func StatContentError(c *gin.Context, path string, err error, status int)

func StatDirError

func StatDirError(c *gin.Context, path string, err error, status int)

Types

type ServerConfig

type ServerConfig struct {
	GetContentFunc  gin.HandlerFunc
	StatContentFunc gin.HandlerFunc
	StatDirFunc     gin.HandlerFunc
	ListFunc        gin.HandlerFunc
	PutContentFunc  gin.HandlerFunc
	MkdirFunc       gin.HandlerFunc
}
var ActiveServerConfig ServerConfig

type StatContent

type StatContent struct {
	LastModified time.Time
	Size         int64
	Checksum     string
}

Jump to

Keyboard shortcuts

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