Documentation ¶
Index ¶
- Constants
- Variables
- func MustID(ctx context.Context, db *mongo.Database, collection string) schema.ID
- func NextID(ctx context.Context, db *mongo.Database, collection string) (schema.ID, error)
- func NrPages(total, pageSize int64) int64
- func Pages(p Pager, total int64) int64
- func QueryInt(r *http.Request, q string) (int64, error)
- type Pager
Constants ¶
View Source
const (
//Counters is the counters collection in mongo
Counters = "counters"
)
View Source
const ( // DefaultPageSize is default page size DefaultPageSize int64 = 100 )
Variables ¶
View Source
var ( //ErrFailedToGetID is base error for generation failure ErrFailedToGetID = errors.New("failed to generate new id") )
Functions ¶
func MustID ¶
MustID must get next available ID, or panic with an error that has error.Is(err, ErrFailedToGetID) == true
Types ¶
Click to show internal directories.
Click to hide internal directories.