MCPcopy Create free account

hub / github.com/danielmesquitta/flight-api / functions

Functions127 in github.com/danielmesquitta/flight-api

↓ 41 callersFunctionNew
NewErr creates a new Err instance from either an error or a string, and sets the Code flag to unknown. This is useful when you want to create an error
internal/domain/errs/errs.go:35
↓ 20 callersMethodReturn
(err error)
internal/provider/cache/mockcache/mockcache_gen.go:194
↓ 16 callersMethodGet
(key string)
internal/provider/cache/fibercache/fibercache.go:25
↓ 12 callersMethodSet
( ctx context.Context, key string, value any, expiration time.Duration, )
internal/provider/cache/cache.go:11
↓ 10 callersMethodEXPECT
()
internal/provider/cache/mockcache/mockcache_gen.go:37
↓ 9 callersFunctionNew
()
internal/pkg/validator/validator.go:23
↓ 8 callersMethodScan
(ctx context.Context, key string, value any)
internal/provider/cache/cache.go:9
↓ 7 callersMethodError
()
internal/domain/errs/errs.go:86
↓ 7 callersMethodRun
(run func(ctx context.Context, key string, value any, expiration time.Duration))
internal/provider/cache/mockcache/mockcache_gen.go:187
↓ 6 callersFunctionNewMockCache
NewMockCache creates a new instance of MockCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expecta
internal/provider/cache/mockcache/mockcache_gen.go:16
↓ 6 callersFunctionNewMockFlightAPI
NewMockFlightAPI creates a new instance of MockFlightAPI. It also registers a testing interface on the mock and a cleanup function to assert the mocks
internal/provider/flightapi/mockflightapi/mockflightapi_gen.go:17
↓ 6 callersMethodSearchFlights
( ctx context.Context, origin, destination string, date time.Time, )
internal/provider/flightapi/flightapi.go:14
↓ 5 callersMethodEXPECT
()
internal/provider/flightapi/mockflightapi/mockflightapi_gen.go:38
↓ 5 callersFunctionNewJWT
( e *env.Env, )
internal/pkg/jwtutil/jwtutil.go:38
↓ 4 callersFunctionBuild
( m *middleware.Middleware, r *router.Router, c cache.Cache, )
internal/app/server/server.go:22
↓ 4 callersFunctionNewAmadeusAPI
(e *env.Env)
internal/provider/flightapi/amadeusapi/amadeusapi.go:14
↓ 4 callersFunctionNewAuthHandler
( luc *auth.LoginUseCase, )
internal/app/server/handler/auth.go:14
↓ 4 callersFunctionNewDocHandler
()
internal/app/server/handler/doc.go:15
↓ 4 callersFunctionNewDuffelAPI
( e *env.Env, )
internal/provider/flightapi/duffelapi/duffelapi.go:13
↓ 4 callersFunctionNewFlightAPIs
( a *amadeusapi.AmadeusAPI, s *serpapi.SerpAPI, d *duffelapi.DuffelAPI, )
internal/provider/flightapi/flightapi.go:21
↓ 4 callersFunctionNewFlightHandler
( sfuc *flight.SearchFlightsUseCase, )
internal/app/server/handler/flight.go:14
↓ 4 callersFunctionNewHealthHandler
()
internal/app/server/handler/health.go:10
↓ 4 callersFunctionNewLoginUseCase
( v validator.Validator, j *jwtutil.JWT, )
internal/domain/usecase/auth/login.go:17
↓ 4 callersFunctionNewMiddleware
( e *env.Env, j *jwtutil.JWT, )
internal/app/server/middleware/middleware.go:13
↓ 4 callersFunctionNewRedisCache
( e *env.Env, )
internal/provider/cache/rediscache/rediscache.go:19
↓ 4 callersFunctionNewRouter
( e *env.Env, m *middleware.Middleware, hh *handler.HealthHandler, dh *handler.DocHandler, ah *handler.Au
internal/app/server/router/router.go:21
↓ 4 callersFunctionNewSearchFlightsUseCase
( v validator.Validator, c cache.Cache, f []flightapi.FlightAPI, )
internal/domain/usecase/flight/search.go:25
↓ 4 callersFunctionNewSerpAPI
(e *env.Env)
internal/provider/flightapi/serpapi/serpapi.go:14
↓ 4 callersMethodauthenticate
(ctx context.Context)
internal/provider/flightapi/amadeusapi/auth.go:40
↓ 3 callersMethodExecute
( ctx context.Context, in LoginUseCaseInput, )
internal/domain/usecase/auth/login.go:36
↓ 3 callersFunctionLoadConfig
(v validator.Validator)
internal/config/config.go:10
↓ 3 callersMethodMakeRequest
( method string, path string, opts ...RequestOption, )
test/integration/server/server.go:154
↓ 3 callersMethodValidate
(data any)
internal/pkg/validator/validator.go:15
↓ 3 callersFunctionWithResponse
WithResponse sets the response object to unmarshal into
test/integration/server/server.go:134
↓ 3 callersMethodhandleInternalServerError
( c *fiber.Ctx, appErr *errs.Err, )
internal/app/server/middleware/error.go:59
↓ 2 callersMethodDelete
( ctx context.Context, keys ...string, )
internal/provider/cache/cache.go:18
↓ 2 callersMethodGet
(c *fiber.Ctx)
internal/app/server/handler/doc.go:19
↓ 2 callersFunctionNewTest
NewTest wires up the application in test mode.
internal/app/server/wire_gen.go:69
↓ 2 callersFunctionNewTestApp
( t *testing.T, )
test/integration/server/server.go:44
↓ 2 callersMethodRegister
( app *fiber.App, )
internal/app/server/router/router.go:39
↓ 2 callersFunctionWithBody
WithBody sets the body for the request
test/integration/server/server.go:106
↓ 2 callersFunctionnewErr
(err any, c Code)
internal/domain/errs/errs.go:43
↓ 1 callersMethodBearerAuthAccessToken
()
internal/app/server/middleware/bearer_auth.go:9
↓ 1 callersFunctionCoalesce
Coalesce returns *p if p is not nil, otherwise v.
internal/pkg/ptr/coalesce.go:4
↓ 1 callersMethodExecute
( ctx context.Context, in SearchFlightsUseCaseInput, )
internal/domain/usecase/flight/search.go:49
↓ 1 callersFunctionGetClaims
( c *fiber.Ctx, )
internal/app/server/handler/handler.go:36
↓ 1 callersMethodLogin
(email, password string)
test/integration/server/server.go:221
↓ 1 callersFunctionNewDev
Injectors from wire.go: NewDev wires up the application in dev mode.
internal/app/server/wire_gen.go:29
↓ 1 callersFunctionNewEnv
(v validator.Validator)
internal/config/env/env.go:40
↓ 1 callersFunctionNewFiberCache
(c cache.Cache)
internal/provider/cache/fibercache/fibercache.go:18
↓ 1 callersFunctionNewProd
NewProd wires up the application in prod mode.
internal/app/server/wire_gen.go:89
↓ 1 callersFunctionNewRedisContainer
( ctx context.Context, )
test/container/redis.go:10
↓ 1 callersFunctionNewStaging
NewStaging wires up the application in staging mode.
internal/app/server/wire_gen.go:49
↓ 1 callersMethodNewToken
(claims UserClaims, tokenType TokenType)
internal/pkg/jwtutil/jwtutil.go:56
↓ 1 callersMethodRecover
()
internal/app/server/middleware/recover.go:11
↓ 1 callersMethodReturn
(flights []entity.Flight, err error)
internal/provider/flightapi/mockflightapi/mockflightapi_gen.go:91
↓ 1 callersFunctionSetDefaultLogger
()
internal/config/log/log.go:8
↓ 1 callersFunctionSetServerTimeZone
()
internal/config/time/time.go:5
↓ 1 callersMethodTimeout
(t time.Duration)
internal/app/server/middleware/timeout.go:10
↓ 1 callersFunctionWithBearerToken
WithToken sets the authorization token for the request
test/integration/server/server.go:120
↓ 1 callersFunctionWithQueryParams
WithQueryParams sets the query parameters for the request
test/integration/server/server.go:148
↓ 1 callersMethodbuildRequestBody
( origin, destination string, date time.Time, )
internal/provider/flightapi/duffelapi/search_flights.go:147
↓ 1 callersMethodgetEnvFile
()
internal/config/env/env.go:77
↓ 1 callersMethodloadEnv
()
internal/config/env/env.go:52
↓ 1 callersFunctionnewLogger
()
test/container/container.go:22
↓ 1 callersFunctionnewLoginUseCase
()
internal/domain/usecase/auth/login_test.go:71
↓ 1 callersFunctionparseDateQueryParam
( c *fiber.Ctx, param QueryParam, )
internal/app/server/handler/handler.go:24
↓ 1 callersMethodparseDuration
(duration string)
internal/provider/flightapi/duffelapi/search_flights.go:192
↓ 1 callersMethodparseDuration
(duration string)
internal/provider/flightapi/amadeusapi/search_flights.go:140
↓ 1 callersMethodrefreshAccessToken
(ctx context.Context)
internal/provider/flightapi/amadeusapi/auth.go:16
↓ 1 callersMethodsetFastestAndCheapest
( flights []entity.Flight, )
internal/domain/usecase/flight/search.go:131
↓ 1 callersMethodsortFlights
( flights []entity.Flight, sortBy, sortOrder string, )
internal/domain/usecase/flight/search.go:155
↓ 1 callersMethodvalidate
()
internal/config/env/env.go:96
MethodClose
()
internal/provider/cache/fibercache/fibercache.go:65
MethodDecode
Decode decodes a JWT and extracts the payload.
internal/pkg/jwtutil/jwtutil.go:67
MethodDelete
( ctx context.Context, keys ...string, )
internal/provider/cache/rediscache/rediscache.go:117
MethodDelete
(key string)
internal/provider/cache/fibercache/fibercache.go:46
MethodDelete
Delete provides a mock function for the type MockCache
internal/provider/cache/mockcache/mockcache_gen.go:42
MethodDelete
Delete is a helper method to define mock.On call - ctx - keys
internal/provider/cache/mockcache/mockcache_gen.go:72
FunctionDeref
Deref returns *p if p is not nil, otherwise the zero value of T.
internal/pkg/ptr/deref.go:4
MethodErrorHandler
(ctx *fiber.Ctx, err error)
internal/app/server/middleware/error.go:26
FunctionFirst
First returns the first non-nil ptr it is passed.
internal/pkg/ptr/first.go:4
MethodHealth
@Summary Health check @Description Health check @Tags Health @Accept json @Produce json @Success 200 {object} dto.HealthResponse @Failure 500 {object}
internal/app/server/handler/health.go:22
MethodIsExpired
IsExpired checks if the token is expired by comparing the expiration time with the current time minus one minute to account for requests that may take
internal/pkg/jwtutil/jwtutil.go:29
MethodLogin
@Summary Login @Description Use e-mail and password to login @Tags Auth @Accept json @Produce json @Param request body dto.LoginRequest true "Request
internal/app/server/handler/auth.go:34
FunctionNew
New allocates a new variable of a given value and returns a ptr to it.
internal/pkg/ptr/new.go:4
FunctionNewDev
NewDev wires up the application in dev mode.
internal/app/server/wire.go:28
FunctionNewProd
NewProd wires up the application in prod mode.
internal/app/server/wire.go:112
FunctionNewStaging
NewStaging wires up the application in staging mode.
internal/app/server/wire.go:56
FunctionNewTest
NewTest wires up the application in test mode.
internal/app/server/wire.go:84
MethodPrintf
(format string, v ...interface{})
test/container/container.go:10
MethodReset
()
internal/provider/cache/fibercache/fibercache.go:55
MethodReturn
(err error)
internal/provider/cache/mockcache/mockcache_gen.go:90
MethodReturn
(ok bool, err error)
internal/provider/cache/mockcache/mockcache_gen.go:146
MethodRun
(run func(ctx context.Context, keys ...string))
internal/provider/cache/mockcache/mockcache_gen.go:77
MethodRun
(run func(ctx context.Context, key string, value any))
internal/provider/cache/mockcache/mockcache_gen.go:139
MethodRun
(run func(ctx context.Context, origin string, destination string, date time.Time))
internal/provider/flightapi/mockflightapi/mockflightapi_gen.go:84
MethodRunAndReturn
(run func(ctx context.Context, keys ...string) error)
internal/provider/cache/mockcache/mockcache_gen.go:95
MethodRunAndReturn
(run func(ctx context.Context, key string, value any) (bool, error))
internal/provider/cache/mockcache/mockcache_gen.go:151
MethodRunAndReturn
(run func(ctx context.Context, key string, value any, expiration time.Duration) error)
internal/provider/cache/mockcache/mockcache_gen.go:199
next →1–100 of 127, ranked by callers