Documentation ¶
Index ¶
- Variables
- func New(cron *scheduler.Scheduler, metric metrics.Metric) lava.HttpRouter
- type GenerateRequest
- type GenerateResponse
- type Id
- func (t *Id) Annotation() []lava.Annotation
- func (t *Id) Generate(ctx *fiber.Ctx, req *GenerateRequest) (*GenerateResponse, error)
- func (t *Id) Init()
- func (t *Id) Middlewares() []lava.Middleware
- func (t *Id) Prefix() string
- func (t *Id) Router(router *lava.Router)
- func (t *Id) Types(ctx *fiber.Ctx, req *TypesRequest) (*TypesResponse, error)
- type TypesRequest
- type TypesResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCodeIDGenerateFailed = &errorpb.ErrCode{ BizCode: int32(100), Code: errorpb.Code_Internal, Name: "gid.err_code.id_generate_failed", Reason: "id generate error", }
Functions ¶
Types ¶
type GenerateRequest ¶
type GenerateRequest struct { // type of id e.g uuid, shortid, snowflake (64 bit), bigflake (128 bit) Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` }
type GenerateResponse ¶
type Id ¶
type Id struct {
// contains filtered or unexported fields
}
func (*Id) Annotation ¶
func (t *Id) Annotation() []lava.Annotation
func (*Id) Generate ¶
func (t *Id) Generate(ctx *fiber.Ctx, req *GenerateRequest) (*GenerateResponse, error)
func (*Id) Middlewares ¶
func (t *Id) Middlewares() []lava.Middleware
func (*Id) Types ¶
func (t *Id) Types(ctx *fiber.Ctx, req *TypesRequest) (*TypesResponse, error)
type TypesRequest ¶
type TypesRequest struct{}
List the types of IDs available. No query params needed.
type TypesResponse ¶
type TypesResponse struct {
Types []string `json:"types,omitempty" doc:"类型" required:"true" example:"[\"a\",\"b\"]" readOnly:"true"`
}
TypesResponse 返回值类型
Click to show internal directories.
Click to hide internal directories.