Documentation ¶
Index ¶
- Variables
- func NewHttpHandler(svc Service, logger log.Logger) http.Handler
- type HttpResponse
- type LoggingMidware
- func (m *LoggingMidware) GetSegments(ctx context.Context, biztag string, count int) (ids []int64, err error)
- func (m *LoggingMidware) GetSnowflakes(ctx context.Context, biztag string, count int) (ids []int64, err error)
- func (m *LoggingMidware) HealthCheck(ctx context.Context, name string) (status int, err error)
- type Midware
- type Option
- type Options
- type Server
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrServiceDisabled = errors.New("service disabled")
)
Functions ¶
Types ¶
type HttpResponse ¶
type LoggingMidware ¶
type LoggingMidware struct { Service // contains filtered or unexported fields }
func (*LoggingMidware) GetSegments ¶
func (*LoggingMidware) GetSnowflakes ¶
func (*LoggingMidware) HealthCheck ¶
type Option ¶
type Option func(opts *Options)
func WithLogger ¶
func WithMidwares ¶
func WithSegmentRepository ¶
func WithSegmentRepository(repo segment.Repository) Option
func WithSnowflakeStorage ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
type Service ¶
type Service interface { GetSegments(ctx context.Context, biztag string, count int) (ids []int64, err error) GetSnowflakes(ctx context.Context, biztag string, count int) (ids []int64, err error) HealthCheck(ctx context.Context, name string) (status int, err error) Close() error }
func NewService ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.