Documentation ¶
Index ¶
- Constants
- func DeleteUser(name string) error
- func LogRequest(r *http.Request)
- func MakePlainTextMessage(hit i2es.ESDoc) []byte
- func Serve(listen string, es ESConf)
- func XFeaturesHandler(w http.ResponseWriter, r *http.Request)
- type Bucket
- type ESConf
- func (es ESConf) AddNewUser(name, email string) (User, error)
- func (ed ESConf) BlacklistTXT(w http.ResponseWriter, r *http.Request)
- func (es ESConf) EHandler(w http.ResponseWriter, r *http.Request)
- func (es ESConf) GetEchoMessageHashes(echo string) []string
- func (es ESConf) GetLimitedEchoMessageHashes(echo string, offset int, limit int) []string
- func (es ESConf) GetListTXT() []byte
- func (es ESConf) GetPlainTextMessage(msgid string) []byte
- func (es ESConf) GetUEchoMessageHashes(echoes string) []string
- func (es ESConf) GetUMMessages(msgs string) []string
- func (es ESConf) GetXC(echoes string) []string
- func (es ESConf) IndexMessage(msg idec.Message) error
- func (es ESConf) IndexUser(user User) error
- func (es ESConf) ListTXTHandler(w http.ResponseWriter, r *http.Request)
- func (es ESConf) MHandler(w http.ResponseWriter, r *http.Request)
- func (es ESConf) PointMessage(req PointRequest, user User) error
- func (es ESConf) UEHandler(w http.ResponseWriter, r *http.Request)
- func (es ESConf) UMHandler(w http.ResponseWriter, r *http.Request)
- func (es ESConf) UPointHandler(w http.ResponseWriter, r *http.Request)
- func (es ESConf) XCHandler(w http.ResponseWriter, r *http.Request)
- type ESDoc
- type ESSearchResp
- type ESSearchShards
- type EchoAgg
- type EchoAggregations
- type EchoBucket
- type Hit
- type Hits
- type MaxIdAggregation
- type PointRequest
- type Uniq
- type User
- type UserHit
- type UserHits
Constants ¶
const ( USERS_INDEX = ".lessmore_points" USERS_DOC_TYPE = "points" NODE_ADDRESS = "dynamic" AUTH_STRING_LENGTH = 16 LETTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" SALT_BYTES = 32 HASH_BYTES = 64 )
Variables ¶
This section is empty.
Functions ¶
func MakePlainTextMessage ¶
MakePlainTextMessage ...
func XFeaturesHandler ¶
func XFeaturesHandler(w http.ResponseWriter, r *http.Request)
XFeaturesHandler list supported features
Types ¶
type ESConf ¶
ESConf ...
func (ESConf) AddNewUser ¶
AddNewUser to the .lessmore_users index
func (ESConf) BlacklistTXT ¶
func (ed ESConf) BlacklistTXT(w http.ResponseWriter, r *http.Request)
func (ESConf) EHandler ¶
func (es ESConf) EHandler(w http.ResponseWriter, r *http.Request)
EHandler /e/ schema
func (ESConf) GetEchoMessageHashes ¶
GetEchoMessageHashes ...
func (ESConf) GetLimitedEchoMessageHashes ¶
GetLimitedEchoMessageHashes ...
func (ESConf) GetPlainTextMessage ¶
GetPlainTextMessage ...
func (ESConf) GetUEchoMessageHashes ¶
GetUEchoMessageHashes ...
func (ESConf) GetUMMessages ¶
func (ESConf) ListTXTHandler ¶
func (es ESConf) ListTXTHandler(w http.ResponseWriter, r *http.Request)
ListTXTHandler ...
func (ESConf) MHandler ¶
func (es ESConf) MHandler(w http.ResponseWriter, r *http.Request)
MHandler /m/ schema
func (ESConf) PointMessage ¶
func (es ESConf) PointMessage(req PointRequest, user User) error
PointMessage add point message into DB
func (ESConf) UEHandler ¶
func (es ESConf) UEHandler(w http.ResponseWriter, r *http.Request)
UEHandler /u/e/ schema
func (ESConf) UMHandler ¶
func (es ESConf) UMHandler(w http.ResponseWriter, r *http.Request)
UMHandler /u/m/ schema
func (ESConf) UPointHandler ¶
func (es ESConf) UPointHandler(w http.ResponseWriter, r *http.Request)
UPointHandler /u/point scheme
type ESDoc ¶
type ESDoc struct { Echo string `json:"echo"` Subg string `json:"subg"` To string `json:"to"` Author string `json:"author"` Message string `json:"message"` Date string `json:"date"` MsgID string `json:"msgid"` Tags string `json:"tags"` Repto string `json:"repto"` Address string `json:"address"` TopicID string `json:"topicid"` }
type ESSearchResp ¶
type ESSearchResp struct { Took int64 `json:"took"` TimedOut bool `json:"timed_out"` ESSearchShards `json:"_shards"` Hits `json:"hits"` }
{"took":467,"timed_out":false,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0},"hits":{"total":89333,"max_score":0.0,"hits":[]}}
type ESSearchShards ¶
type EchoAggregations ¶
type EchoAggregations struct { EchoAgg map[string]EchoAgg `json:"aggregations"` UniqEcho map[string]Uniq `json:"uniqueEcho"` }
"aggregations":{"echo":{"doc_count_error_upper_bound":2406,"sum_other_doc_count":76555,"buckets":[{"key":"bash.rss","doc_count":12779}]},"uniqueEcho":{"value":121}}}
type EchoBucket ¶
type Hit ¶
type Hit struct { Index string `json:"_index"` Type string `json:"_type"` ID string `json:"_id"` Source i2es.ESDoc `json:"_source"` }
{"_index":"idec5","_type":"post","_id":"aAjSbXS5XeNF6lVaPh5A","_score":1.0,"_source"
type MaxIdAggregation ¶
type PointRequest ¶
PointRequest with message
type User ¶
type User struct { // Will be added to the address: // i.e. dynamic,1 UserID int64 `json:"user_id"` // Will be added to the bundled message Name string `json:"name"` // Email address needs for password restore Email string `json:"email"` AuthString string `json:"auth_string"` Address string `json:"address"` // Created time Created int64 `json:"created"` }
User document structure
type UserHit ¶
type UserHit struct { Index string `json:"_index"` Type string `json:"_type"` ID string `json:"_id"` Score float64 `json:"_score"` Source User `json:"_source"` }
{ "_index":".lessmore_users","_type":"user","_id":"1","_score":1.0,
"_source":{"id": 1, "address": "dynamic", "name": "name", "authString": "thisIsAtest"}}