Documentation ¶
Index ¶
- Variables
- func New(cron *scheduler.Scheduler, metric metrics.Metric) lava.HttpRouter
- type GenerateRequest
- type GenerateResponse
- type Id
- func (t *Id) Generate(ctx context.Context, req *GenerateRequest) (*GenerateResponse, error)
- func (t *Id) Init()
- func (t *Id) Middlewares() []lava.Middleware
- func (t *Id) Openapi(swag *opendoc.Swagger)
- func (t *Id) Router(app fiber.Router)
- func (t *Id) Types(ctx context.Context, req *TypesRequest) (*TypesResponse, error)
- func (t *Id) Version() string
- type TypesRequest
- type TypesResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSrvErrCodeIDGenerateFailed = errors.NewCode(errorpb.Code_Internal).SetStatus("gid.srv.id_generate_failed").SetReason("id generate error")
View Source
var ErrSrvErrCodeOK = errors.NewCode(errorpb.Code_OK).SetStatus("gid.srv.ok").SetReason("ok")
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) Generate ¶
func (t *Id) Generate(ctx context.Context, req *GenerateRequest) (*GenerateResponse, error)
func (*Id) Middlewares ¶
func (t *Id) Middlewares() []lava.Middleware
func (*Id) Types ¶
func (t *Id) Types(ctx context.Context, 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 `protobuf:"bytes,1,rep,name=types,proto3" json:"types,omitempty"`
}
TypesResponse 返回值类型
Click to show internal directories.
Click to hide internal directories.