utils

package
v0.0.0-...-f3f5277 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URL           = "http://localhost:5000/"
	ROOT          = "images"
	HiddenFile    = ".env.yml"
	MAX_FILE_SIZE = 8 << 20 // 8 MiB
	ROOT_PP       = "avatar/"
	MEDIA_ROOT    = "media"
	MEDIA_URL     = "media/"
)

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func CreateFlatZip

func CreateFlatZip(w io.Writer, files ...string) error

func GetRepoFile

func GetRepoFile(name string) string

func Hash

func Hash(s string) uint32

func HashPassword

func HashPassword(password string) (string, error)

func NewRedisDB

func NewRedisDB(host, port, password string) *redis.Client

func Unzip

func Unzip(src, dest string) error

Types

type ReposInfo

type ReposInfo struct {
	Hash       uint32 `yaml:"hash"`
	Owner      string `yaml:"owner"`
	FolderName string `yaml:"folder_name"`
}

func (*ReposInfo) Marshall

func (r *ReposInfo) Marshall() ([]byte, error)

func (*ReposInfo) Unmarshall

func (r *ReposInfo) Unmarshall(src string) error

Jump to

Keyboard shortcuts

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