Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIndexes ¶
func CreateIndexes()
CreateIndexes creates indexes for three collections: url, statistics and counter.
Types ¶
type Counter ¶
Counter is a document structure for the collection counter. It is used for id sequence.
type Server ¶
type Server struct { Version string `json:"version"` Platform string `json:"platform"` GoVersion string `json:"go"` GoPlatform string `json:"goPlatform"` }
Server information about version, go version and platform.
type Stats ¶
type Stats struct {
Clicks int `bson:"clicks" json:"clicks,omitempty"`
}
Stats is a document structure for the collection statistics. It is used for making statistics.
type URL ¶
type URL struct { Status int `bson:",omitempty" json:"status"` Hash string `bson:"hash" json:"-"` ID string `bson:"id" json:"id,omitempty"` TargetURL string `bson:",omitempty" json:"targeturl,omitempty"` LongURL string `bson:"longurl" json:"longurl,omitempty"` Timestamp *time.Time `bson:"ts" json:"ts,omitempty"` Stats []Stats `bson:"stats,omitempty" json:"stats,omitempty"` }
URL is a document structure for the collection url. It is used to store url(s).
func (*URL) ReadyToInsert ¶
ReadyToInsert fills document.
Click to show internal directories.
Click to hide internal directories.