Versions in this module Expand all Collapse all v1 v1.0.0 Oct 16, 2020 Changes in this version + func ExtractHttp(r *http.Request) func() *model.SpanContext + func Wrapper(f HandlerFunc) gin.HandlerFunc + type BaseService struct + func (s *BaseService) Call(ctx context.Context, service string, method string, args interface{}, ...) error + func (s *BaseService) Client() *httpclient.ReqClient + func (s *BaseService) CustomContext(key string) interface{} + func (s *BaseService) Delete(handler *Handler) HandlerFunc + func (s *BaseService) DeleteBatch(handler *Handler) HandlerFunc + func (s *BaseService) Get(handler *Handler) HandlerFunc + func (s *BaseService) GetList(handler *Handler) HandlerFunc + func (s *BaseService) Head(handler *Handler) HandlerFunc + func (s *BaseService) Interceptor() *Interceptor + func (s *BaseService) Mongo() *mongo.MgoClient + func (s *BaseService) Node() *NodeInfo + func (s *BaseService) Options(handler *Handler) HandlerFunc + func (s *BaseService) Patch(handler *Handler) HandlerFunc + func (s *BaseService) Post(handler *Handler) HandlerFunc + func (s *BaseService) Put(handler *Handler) HandlerFunc + func (s *BaseService) Redis() *redis.RdClient + func (s *BaseService) Reg() *Registry + func (s *BaseService) Repo() *repo.Repository + func (s *BaseService) SetClient(client *httpclient.ReqClient) + func (s *BaseService) SetCustomContext(key string, value interface{}) + func (s *BaseService) SetInterceptor(op *Interceptor) + func (s *BaseService) SetMongo(client *mongo.MgoClient) + func (s *BaseService) SetNode(node *NodeInfo) + func (s *BaseService) SetRedis(redisClient *redis.RdClient) + func (s *BaseService) SetReg(reg *Registry) + func (s *BaseService) SetRepo(repository *repo.Repository) + func (s *BaseService) Use(handler *Handler) + type Ctx struct + func (c *Ctx) Csv(data []byte, filename string) + func (c *Ctx) Failure(code int, err error, actual ...bool) + func (c *Ctx) FileStream(data []byte, filename string) + func (c *Ctx) Pdf(data []byte, filename string) + func (c *Ctx) Response(code int, data interface{}, err error) + func (c *Ctx) SetUser(user interface{}) + func (c *Ctx) SetUserGUID(guid uuid.GUID) + func (c *Ctx) SetUserID(id int) + func (c *Ctx) SetUserInfo(userInfo string) + func (c *Ctx) Success(data interface{}) + func (c *Ctx) User() interface{} + func (c *Ctx) UserGUID() (uuid.GUID, bool) + func (c *Ctx) UserID() (int, bool) + func (c *Ctx) UserInfo() (string, bool) + type Handler struct + GinMiddleware []gin.HandlerFunc + HttpMethod string + Middleware []Middleware + RelativePath string + func (h *Handler) Delete(path string) + func (h *Handler) Get(path string) + func (h *Handler) Head(path string) + func (h *Handler) Options(path string) + func (h *Handler) Patch(path string) + func (h *Handler) Post(path string) + func (h *Handler) Put(path string) + func (h *Handler) Route(httpMethod string, path string) + func (h *Handler) Use(handlerFunc ...gin.HandlerFunc) + func (h *Handler) UseMiddleware(m ...Middleware) + type HandlerFunc func(*Ctx) + type IBaseService interface + Client func() *httpclient.ReqClient + CustomContext func(string) interface{} + Delete func(*Handler) HandlerFunc + DeleteBatch func(*Handler) HandlerFunc + Get func(*Handler) HandlerFunc + GetList func(*Handler) HandlerFunc + Head func(*Handler) HandlerFunc + Interceptor func() *Interceptor + Mongo func() *mongo.MgoClient + Node func() *NodeInfo + Options func(*Handler) HandlerFunc + Patch func(*Handler) HandlerFunc + Post func(*Handler) HandlerFunc + Put func(*Handler) HandlerFunc + Redis func() *redis.RdClient + Reg func() *Registry + Repo func() *repo.Repository + SetClient func(*httpclient.ReqClient) + SetCustomContext func(string, interface{}) + SetInterceptor func(*Interceptor) + SetMongo func(*mongo.MgoClient) + SetNode func(*NodeInfo) + SetRedis func(*redis.RdClient) + SetReg func(*Registry) + SetRepo func(*repo.Repository) + Use func(*Handler) + func NewService(service IBaseService, option ...Option) IBaseService + type Interceptor struct + Cb *breaker.CircuitBreaker + Limiter *limit.Limiter + Metric *metric.Metric + Tracer *tracing.Tracer + type Middleware func(IBaseService) HandlerFunc + func AuthMiddleware() Middleware + func BreakerMiddleware(cb *breaker.CircuitBreaker) Middleware + func DelayLimiterMiddleware(limiter *limit.Limiter) Middleware + func ExtractHttpMiddleware() Middleware + func MetricMiddleware(m *metric.Metric) Middleware + func RateLimiterMiddleware(limiter *limit.Limiter) Middleware + func ReserveLimiterMiddleware(limiter *limit.Limiter) Middleware + func TracerMiddleware(t *tracing.Tracer, name string) Middleware + type NodeInfo struct + Address string + Id string + Name string + Port string + ServerName string + type Option func(service IBaseService) + func Cb(circuitBreaker *breaker.CircuitBreaker) Option + func CustomContext(key string, value interface{}) Option + func Limiter(limiter *limit.Limiter) Option + func Metric(m *metric.Metric) Option + func MongoClient(client *mongo.MgoClient) Option + func RedisClient(redisClient *redis.RdClient) Option + func Repository(repository *repo.Repository) Option + func Tracer(tracer *tracing.Tracer) Option + type Registry struct + Services []*NodeInfo + func NewRegistry(addr string, s ...selector.Selector) *Registry + func (r *Registry) Deregister(node *NodeInfo, group *sync.WaitGroup, errChan chan error) + func (r *Registry) GetService(name string) (*NodeInfo, error) + func (r *Registry) Inject(service IBaseService) + func (r *Registry) InjectSlice(services ...IBaseService) + func (r *Registry) Register(node *NodeInfo, group *sync.WaitGroup, errChan chan error)