util

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogName          = "mailman.log"
	MailTemplateType = "responsive"
)

Variables

View Source
var (
	KVBucketName       = []byte("kv")
	AccountBucketName  = []byte("account")
	ContactsBucketName = []byte("contacts")
	SmtpBucketName     = []byte("smtp")

	KeyNotFoundErr = errors.New("Key Not Found")
)
View Source
var (
	FileLog    = logrus.New()
	ConfigPath = map[string]string{
		"dbPath":       "/.mailman/db",
		"logPath":      "/.mailman/log",
		"tmpPath":      "/.mailman/tmp",
		"htpasswdPath": "/.mailman/.htpasswd",
	}
	DBPath                string
	DefaultLang           = "en"
	SMTPServerNotFoundErr = errors.New("SMTP Server Not Found")
)

Functions

func CreateConfigDir

func CreateConfigDir() error

func CreateDirectory added in v0.4.2

func CreateDirectory(path string, defaultMode os.FileMode) error

func GetContentFromStatik added in v0.4.3

func GetContentFromStatik(name string) (string, error)

func GetHomeDir

func GetHomeDir() string

func GetTmpDir

func GetTmpDir() string

func GetUser added in v0.4.0

func GetUser() string

Types

type BoltStore

type BoltStore struct {
	// contains filtered or unexported fields
}

func NewBoltStore

func NewBoltStore(path string) (*BoltStore, error)

func (*BoltStore) Close

func (b *BoltStore) Close() error

defer close

func (*BoltStore) Delete

func (b *BoltStore) Delete(k, bucketName []byte) error

func (*BoltStore) DeleteBucket

func (b *BoltStore) DeleteBucket(bucketName []byte) error

func (*BoltStore) Get

func (b *BoltStore) Get(k, bucketName []byte) ([]byte, error)

func (*BoltStore) GetRange

func (b *BoltStore) GetRange(bucketName []byte) (map[string]string, []string, error)

func (*BoltStore) Set

func (b *BoltStore) Set(k, v, bucketName []byte) error

type Msg

type Msg struct {
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,emitempty"`
}

Jump to

Keyboard shortcuts

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