Documentation ¶
Index ¶
- type Api
- func (sc *Api) Attached(method string) bool
- func (a *Api) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Api) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (a *Api) List(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Api) Read(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (a *Api) Replace(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (a *Api) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- type Message
- type MessageInput
- type MessageStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
*MessageStore
}
composition
func (*Api) Create ¶
func (a *Api) Create(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func (*Api) Delete ¶
func (a *Api) Delete(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func (*Api) List ¶
func (a *Api) List(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func (*Api) Read ¶
func (a *Api) Read(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func (*Api) Replace ¶
func (a *Api) Replace(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
func (*Api) Update ¶
func (a *Api) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
type Message ¶
type Message struct { Id_ bson.ObjectId `json:"-" bson:"_id"` MessageInput Recvtime time.Time // original submission time Modtime time.Time // time of last modification Userid string // foreign key Username string Tags []string `json:,omitempty bson:,omitempty` // foreign keys Mentions []string `json:,omitempty bson:,omitempty` // foreign keys }
type MessageInput ¶
type MessageStore ¶
type MessageStore struct {
// contains filtered or unexported fields
}
receiver type
func NewMessageStore ¶
func NewMessageStore(dbsession *mgo.Session, dbname string, db *sql.DB, users *userapi.UserCache) *MessageStore
generator
func (*MessageStore) AddMessage ¶
func (ms *MessageStore) AddMessage(message *Message) error
func (*MessageStore) GetMessage ¶
func (ms *MessageStore) GetMessage(id string) (*Message, error)
func (*MessageStore) GetMessages ¶
func (ms *MessageStore) GetMessages(startTime, endTime time.Time) ([]Message, error)
func (*MessageStore) RemoveMessage ¶
func (ms *MessageStore) RemoveMessage(id string) error
Click to show internal directories.
Click to hide internal directories.