Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionProvider ¶
type SessionProvider struct { URL string // contains filtered or unexported fields }
SessionProvider connects and provides session for mongo DB
func NewSessionProvider ¶
func NewSessionProvider(url string) (*SessionProvider, error)
NewSessionProvider creates Mongo session provider
func (*SessionProvider) Healthy ¶
func (sp *SessionProvider) Healthy() error
Healthy checks if mongo DB is up
func (*SessionProvider) NewSession ¶
func (sp *SessionProvider) NewSession() (mongo.Session, error)
NewSession creates mongo session
type TextRecord ¶
type TextRecord struct { ID string `json:"id"` Type int `json:"type"` Text string `json:"text"` Created time.Time `json:"created,omitempty"` Tags []string `json:"tags,omitempty"` }
TextRecord data in mongo db
type TextSaver ¶
type TextSaver struct {
SessionProvider *SessionProvider
}
TextSaver saves text to mongo DB
func NewTextSaver ¶
func NewTextSaver(sessionProvider *SessionProvider) (*TextSaver, error)
NewTextSaver creates TextSaver instance
Click to show internal directories.
Click to hide internal directories.