Documentation ¶
Index ¶
- Constants
- Variables
- type Access
- type AccessLog
- type AccessLogLevelDBImpl
- func (a *AccessLogLevelDBImpl) Access(ip net.IP, docID string)
- func (a *AccessLogLevelDBImpl) GetLatestAccess() []string
- func (a *AccessLogLevelDBImpl) GetLatestLogin() []string
- func (a *AccessLogLevelDBImpl) Login(ip net.IP)
- func (a *AccessLogLevelDBImpl) Start(path string) error
- func (a *AccessLogLevelDBImpl) Stop()
- type Author
- func (a *Author) ChangePwd(pwd string)
- func (a *Author) Close(confPath string)
- func (a *Author) GetEmail() string
- func (a *Author) Login(pwd string, ip net.IP) (bool, string)
- func (a *Author) MarshalJSON(webDN string) ([]byte, error)
- func (a *Author) SetAvatar(avatar string) error
- func (a *Author) SetEmail(email string) error
- func (a *Author) SetNormal(in ...string) error
- func (a *Author) Start(confPath string) error
- func (a *Author) TokenMatch(token string, fromIP net.IP) bool
- type DocumentComparer
- type DocumentDataBase
- type DocumentLevelDB
- func (ddb *DocumentLevelDB) AddTag(t []string) error
- func (ddb *DocumentLevelDB) Close()
- func (ddb *DocumentLevelDB) DeleteDoc(key []byte) (err error)
- func (ddb *DocumentLevelDB) GetDocument(key []byte) (content []byte, err error)
- func (ddb *DocumentLevelDB) GetDocumentByTag(tag []string) []string
- func (ddb *DocumentLevelDB) GetMate(key []byte, length int) ([]byte, error)
- func (ddb *DocumentLevelDB) GetTags() map[string][]string
- func (ddb *DocumentLevelDB) Init(dbPath string, hookAfterInitDB func(dbPath string)) (err error)
- func (ddb *DocumentLevelDB) Push(content []byte, mate *DocumentMate) (err error)
- func (ddb *DocumentLevelDB) RemoveTag(tagKey string) (err error)
- type DocumentMate
- type Login
- type LoginTimes
Constants ¶
View Source
const ( None = iota Top )
View Source
const ( DocDBPath = "./doc" ImageBDPath = "./imageDB" ImagePath = "./image" DefaultDBPathConfig = "/tmp/painter" ConfigDBPath = "db" )
View Source
const AccessDBPath = "./access"
Variables ¶
View Source
var GlobalDBPath string
GlobalDBPath absolute path for database
View Source
var ImageStoreSingleCase imageStore.ImageStore
Functions ¶
This section is empty.
Types ¶
type AccessLog ¶
type AccessLog interface { Login(net.IP) Access(ip net.IP, docID string) GetLatestAccess() []string GetLatestLogin() []string Start(path string) error Stop() }
var AccessLogSingleCase AccessLog
type AccessLogLevelDBImpl ¶
type AccessLogLevelDBImpl struct {
// contains filtered or unexported fields
}
func (*AccessLogLevelDBImpl) Access ¶
func (a *AccessLogLevelDBImpl) Access(ip net.IP, docID string)
func (*AccessLogLevelDBImpl) GetLatestAccess ¶
func (a *AccessLogLevelDBImpl) GetLatestAccess() []string
func (*AccessLogLevelDBImpl) GetLatestLogin ¶
func (a *AccessLogLevelDBImpl) GetLatestLogin() []string
func (*AccessLogLevelDBImpl) Login ¶
func (a *AccessLogLevelDBImpl) Login(ip net.IP)
func (*AccessLogLevelDBImpl) Start ¶
func (a *AccessLogLevelDBImpl) Start(path string) error
func (*AccessLogLevelDBImpl) Stop ¶
func (a *AccessLogLevelDBImpl) Stop()
type Author ¶
var AuthorSingleCase Author
func (*Author) Login ¶
Login login todo 当前先传递口令明文,保存scrypt return bool value and a token 如果返回true,这把token设置到cookie即可
func (*Author) MarshalJSON ¶
MarshalJSON Marshaler {title: "Painter Qiao",
subTitle: "for dear & love", avatar: "http://.../avatar.jpeg", lastLogin: 123213213, name: "Painter Qiao", ipc: "", github: "", say: "a blog for dear & love" email: ""}
type DocumentComparer ¶
type DocumentComparer struct{}
func (DocumentComparer) Compare ¶
func (DocumentComparer) Compare(a, b []byte) int
func (DocumentComparer) Name ¶
func (DocumentComparer) Name() string
func (DocumentComparer) Separator ¶
func (DocumentComparer) Separator(dst, a, b []byte) []byte
func (DocumentComparer) Successor ¶
func (DocumentComparer) Successor(dst, b []byte) []byte
type DocumentDataBase ¶
type DocumentDataBase interface { Init(dbPath string, hookAfterInitDB func(dbPath string)) (err error) Close() GetDocument(key []byte) (content []byte, err error) GetMate(key []byte, length int) ([]byte, error) GetDocumentByTag(tag []string) []string //相同的key会覆盖 Push(content []byte, mate *DocumentMate) (err error) //tag GetTags() map[string][]string //delete DeleteDoc(key []byte) error AddTag([]string) error }
DocumentDataBase document data base
var DocumentDataBaseSingleCase DocumentDataBase
type DocumentLevelDB ¶
type DocumentLevelDB struct {
// contains filtered or unexported fields
}
func (*DocumentLevelDB) AddTag ¶
func (ddb *DocumentLevelDB) AddTag(t []string) error
func (*DocumentLevelDB) Close ¶
func (ddb *DocumentLevelDB) Close()
func (*DocumentLevelDB) DeleteDoc ¶
func (ddb *DocumentLevelDB) DeleteDoc(key []byte) (err error)
func (*DocumentLevelDB) GetDocument ¶
func (ddb *DocumentLevelDB) GetDocument(key []byte) (content []byte, err error)
func (*DocumentLevelDB) GetDocumentByTag ¶
func (ddb *DocumentLevelDB) GetDocumentByTag(tag []string) []string
func (*DocumentLevelDB) GetMate ¶
func (ddb *DocumentLevelDB) GetMate(key []byte, length int) ([]byte, error)
func (*DocumentLevelDB) GetTags ¶
func (ddb *DocumentLevelDB) GetTags() map[string][]string
func (*DocumentLevelDB) Init ¶
func (ddb *DocumentLevelDB) Init(dbPath string, hookAfterInitDB func(dbPath string)) (err error)
func (*DocumentLevelDB) Push ¶
func (ddb *DocumentLevelDB) Push(content []byte, mate *DocumentMate) (err error)
相同的key会覆盖 自动维护 calibration 使用事务
func (*DocumentLevelDB) RemoveTag ¶
func (ddb *DocumentLevelDB) RemoveTag(tagKey string) (err error)
type DocumentMate ¶
type DocumentMate struct { ID string `json:"id"` Title string `json:"title"` SubTitle string `json:"subTitle"` Tags []string `json:"tags"` Attr int `json:"attr"` LastTime int64 `json:"time"` Abstract string `json:"abstract"` }
DocumentMate mate of document
type LoginTimes ¶
type LoginTimes struct {
// contains filtered or unexported fields
}
var LoginTimesLog LoginTimes
Source Files ¶
Click to show internal directories.
Click to hide internal directories.