Versions in this module Expand all Collapse all v1 v1.10.0 Dec 27, 2024 v1.9.0 Aug 11, 2024 v1.8.2 Jun 22, 2024 v1.8.1 Nov 19, 2023 v1.8.0 Aug 8, 2023 v1.7.0 Jan 5, 2023 v1.6.0 Jun 16, 2022 v1.4.0 Jan 3, 2022 Changes in this version + var ErrMissingHeader = errors.New("the length of the `Authorization` header is zero") + func Error(c *gin.Context, err error) + func HealthCheck(c *gin.Context) + func RouteNotFound(c *gin.Context) + func Sign(ctx context.Context, payload map[string]interface{}, secret string, ...) (tokenString string, err error) + func Success(c *gin.Context, data interface{}) + type App struct + func New(opts ...Option) *App + func (a *App) Run() error + func (a *App) Stop() error + type Config struct + CSRF bool + CtxDefaultTimeout time.Duration + Debug bool + EnablePprof bool + EnableTrace bool + GRPC ServerConfig + HTTP ServerConfig + JwtSecret string + JwtTimeout int + Mode string + Name string + PprofPort string + SSL bool + URL string + Version string + var Conf *Config + type Option func(o *options) + func WithContext(ctx context.Context) Option + func WithEndpoint(endpoints ...*url.URL) Option + func WithID(id string) Option + func WithLogger(logger log.Logger) Option + func WithMetadata(md map[string]string) Option + func WithName(name string) Option + func WithRegistry(r registry.Registry) Option + func WithServer(srv ...transport.Server) Option + func WithSignal(sigs ...os.Signal) Option + func WithVersion(version string) Option + type Payload struct + UserID uint64 + func Parse(tokenString string, secret string) (*Payload, error) + func ParseRequest(c *gin.Context) (*Payload, error) + type Response struct + Code int + Data interface{} + Details []string + Message string + func NewResponse() *Response + func (r *Response) Error(c *gin.Context, err error) + func (r *Response) Success(c *gin.Context, data interface{}) + type ServerConfig struct + Addr string + Network string + ReadTimeout time.Duration + WriteTimeout time.Duration + type ValidError struct + Key string + Message string + func (v *ValidError) Error() string + type ValidErrors []*ValidError + func BindAndValid(c *gin.Context, v interface{}) (bool, ValidErrors) + func (v ValidErrors) Error() string + func (v ValidErrors) Errors() []string v0 v0.0.18-test May 20, 2023 v0.0.17-test May 20, 2023 v0.0.16-test May 20, 2023 v0.0.15-test May 20, 2023 v0.0.14-test May 20, 2023 v0.0.13-test May 20, 2023 v0.0.9-test May 6, 2023 v0.0.8-test May 6, 2023 v0.0.1-test May 2, 2023