Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/danielmesquitta/flight-api
/ functions
Functions
127 in github.com/danielmesquitta/flight-api
⨍
Functions
127
◇
Types & classes
74
↓ 41 callers
Function
New
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 callers
Method
Return
(err error)
internal/provider/cache/mockcache/mockcache_gen.go:194
↓ 16 callers
Method
Get
(key string)
internal/provider/cache/fibercache/fibercache.go:25
↓ 12 callers
Method
Set
( ctx context.Context, key string, value any, expiration time.Duration, )
internal/provider/cache/cache.go:11
↓ 10 callers
Method
EXPECT
()
internal/provider/cache/mockcache/mockcache_gen.go:37
↓ 9 callers
Function
New
()
internal/pkg/validator/validator.go:23
↓ 8 callers
Method
Scan
(ctx context.Context, key string, value any)
internal/provider/cache/cache.go:9
↓ 7 callers
Method
Error
()
internal/domain/errs/errs.go:86
↓ 7 callers
Method
Run
(run func(ctx context.Context, key string, value any, expiration time.Duration))
internal/provider/cache/mockcache/mockcache_gen.go:187
↓ 6 callers
Function
NewMockCache
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 callers
Function
NewMockFlightAPI
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 callers
Method
SearchFlights
( ctx context.Context, origin, destination string, date time.Time, )
internal/provider/flightapi/flightapi.go:14
↓ 5 callers
Method
EXPECT
()
internal/provider/flightapi/mockflightapi/mockflightapi_gen.go:38
↓ 5 callers
Function
NewJWT
( e *env.Env, )
internal/pkg/jwtutil/jwtutil.go:38
↓ 4 callers
Function
Build
( m *middleware.Middleware, r *router.Router, c cache.Cache, )
internal/app/server/server.go:22
↓ 4 callers
Function
NewAmadeusAPI
(e *env.Env)
internal/provider/flightapi/amadeusapi/amadeusapi.go:14
↓ 4 callers
Function
NewAuthHandler
( luc *auth.LoginUseCase, )
internal/app/server/handler/auth.go:14
↓ 4 callers
Function
NewDocHandler
()
internal/app/server/handler/doc.go:15
↓ 4 callers
Function
NewDuffelAPI
( e *env.Env, )
internal/provider/flightapi/duffelapi/duffelapi.go:13
↓ 4 callers
Function
NewFlightAPIs
( a *amadeusapi.AmadeusAPI, s *serpapi.SerpAPI, d *duffelapi.DuffelAPI, )
internal/provider/flightapi/flightapi.go:21
↓ 4 callers
Function
NewFlightHandler
( sfuc *flight.SearchFlightsUseCase, )
internal/app/server/handler/flight.go:14
↓ 4 callers
Function
NewHealthHandler
()
internal/app/server/handler/health.go:10
↓ 4 callers
Function
NewLoginUseCase
( v validator.Validator, j *jwtutil.JWT, )
internal/domain/usecase/auth/login.go:17
↓ 4 callers
Function
NewMiddleware
( e *env.Env, j *jwtutil.JWT, )
internal/app/server/middleware/middleware.go:13
↓ 4 callers
Function
NewRedisCache
( e *env.Env, )
internal/provider/cache/rediscache/rediscache.go:19
↓ 4 callers
Function
NewRouter
( e *env.Env, m *middleware.Middleware, hh *handler.HealthHandler, dh *handler.DocHandler, ah *handler.Au
internal/app/server/router/router.go:21
↓ 4 callers
Function
NewSearchFlightsUseCase
( v validator.Validator, c cache.Cache, f []flightapi.FlightAPI, )
internal/domain/usecase/flight/search.go:25
↓ 4 callers
Function
NewSerpAPI
(e *env.Env)
internal/provider/flightapi/serpapi/serpapi.go:14
↓ 4 callers
Method
authenticate
(ctx context.Context)
internal/provider/flightapi/amadeusapi/auth.go:40
↓ 3 callers
Method
Execute
( ctx context.Context, in LoginUseCaseInput, )
internal/domain/usecase/auth/login.go:36
↓ 3 callers
Function
LoadConfig
(v validator.Validator)
internal/config/config.go:10
↓ 3 callers
Method
MakeRequest
( method string, path string, opts ...RequestOption, )
test/integration/server/server.go:154
↓ 3 callers
Method
Validate
(data any)
internal/pkg/validator/validator.go:15
↓ 3 callers
Function
WithResponse
WithResponse sets the response object to unmarshal into
test/integration/server/server.go:134
↓ 3 callers
Method
handleInternalServerError
( c *fiber.Ctx, appErr *errs.Err, )
internal/app/server/middleware/error.go:59
↓ 2 callers
Method
Delete
( ctx context.Context, keys ...string, )
internal/provider/cache/cache.go:18
↓ 2 callers
Method
Get
(c *fiber.Ctx)
internal/app/server/handler/doc.go:19
↓ 2 callers
Function
NewTest
NewTest wires up the application in test mode.
internal/app/server/wire_gen.go:69
↓ 2 callers
Function
NewTestApp
( t *testing.T, )
test/integration/server/server.go:44
↓ 2 callers
Method
Register
( app *fiber.App, )
internal/app/server/router/router.go:39
↓ 2 callers
Function
WithBody
WithBody sets the body for the request
test/integration/server/server.go:106
↓ 2 callers
Function
newErr
(err any, c Code)
internal/domain/errs/errs.go:43
↓ 1 callers
Method
BearerAuthAccessToken
()
internal/app/server/middleware/bearer_auth.go:9
↓ 1 callers
Function
Coalesce
Coalesce returns *p if p is not nil, otherwise v.
internal/pkg/ptr/coalesce.go:4
↓ 1 callers
Method
Execute
( ctx context.Context, in SearchFlightsUseCaseInput, )
internal/domain/usecase/flight/search.go:49
↓ 1 callers
Function
GetClaims
( c *fiber.Ctx, )
internal/app/server/handler/handler.go:36
↓ 1 callers
Method
Login
(email, password string)
test/integration/server/server.go:221
↓ 1 callers
Function
NewDev
Injectors from wire.go: NewDev wires up the application in dev mode.
internal/app/server/wire_gen.go:29
↓ 1 callers
Function
NewEnv
(v validator.Validator)
internal/config/env/env.go:40
↓ 1 callers
Function
NewFiberCache
(c cache.Cache)
internal/provider/cache/fibercache/fibercache.go:18
↓ 1 callers
Function
NewProd
NewProd wires up the application in prod mode.
internal/app/server/wire_gen.go:89
↓ 1 callers
Function
NewRedisContainer
( ctx context.Context, )
test/container/redis.go:10
↓ 1 callers
Function
NewStaging
NewStaging wires up the application in staging mode.
internal/app/server/wire_gen.go:49
↓ 1 callers
Method
NewToken
(claims UserClaims, tokenType TokenType)
internal/pkg/jwtutil/jwtutil.go:56
↓ 1 callers
Method
Recover
()
internal/app/server/middleware/recover.go:11
↓ 1 callers
Method
Return
(flights []entity.Flight, err error)
internal/provider/flightapi/mockflightapi/mockflightapi_gen.go:91
↓ 1 callers
Function
SetDefaultLogger
()
internal/config/log/log.go:8
↓ 1 callers
Function
SetServerTimeZone
()
internal/config/time/time.go:5
↓ 1 callers
Method
Timeout
(t time.Duration)
internal/app/server/middleware/timeout.go:10
↓ 1 callers
Function
WithBearerToken
WithToken sets the authorization token for the request
test/integration/server/server.go:120
↓ 1 callers
Function
WithQueryParams
WithQueryParams sets the query parameters for the request
test/integration/server/server.go:148
↓ 1 callers
Method
buildRequestBody
( origin, destination string, date time.Time, )
internal/provider/flightapi/duffelapi/search_flights.go:147
↓ 1 callers
Method
getEnvFile
()
internal/config/env/env.go:77
↓ 1 callers
Method
loadEnv
()
internal/config/env/env.go:52
↓ 1 callers
Function
newLogger
()
test/container/container.go:22
↓ 1 callers
Function
newLoginUseCase
()
internal/domain/usecase/auth/login_test.go:71
↓ 1 callers
Function
parseDateQueryParam
( c *fiber.Ctx, param QueryParam, )
internal/app/server/handler/handler.go:24
↓ 1 callers
Method
parseDuration
(duration string)
internal/provider/flightapi/duffelapi/search_flights.go:192
↓ 1 callers
Method
parseDuration
(duration string)
internal/provider/flightapi/amadeusapi/search_flights.go:140
↓ 1 callers
Method
refreshAccessToken
(ctx context.Context)
internal/provider/flightapi/amadeusapi/auth.go:16
↓ 1 callers
Method
setFastestAndCheapest
( flights []entity.Flight, )
internal/domain/usecase/flight/search.go:131
↓ 1 callers
Method
sortFlights
( flights []entity.Flight, sortBy, sortOrder string, )
internal/domain/usecase/flight/search.go:155
↓ 1 callers
Method
validate
()
internal/config/env/env.go:96
Method
Close
()
internal/provider/cache/fibercache/fibercache.go:65
Method
Decode
Decode decodes a JWT and extracts the payload.
internal/pkg/jwtutil/jwtutil.go:67
Method
Delete
( ctx context.Context, keys ...string, )
internal/provider/cache/rediscache/rediscache.go:117
Method
Delete
(key string)
internal/provider/cache/fibercache/fibercache.go:46
Method
Delete
Delete provides a mock function for the type MockCache
internal/provider/cache/mockcache/mockcache_gen.go:42
Method
Delete
Delete is a helper method to define mock.On call - ctx - keys
internal/provider/cache/mockcache/mockcache_gen.go:72
Function
Deref
Deref returns *p if p is not nil, otherwise the zero value of T.
internal/pkg/ptr/deref.go:4
Method
ErrorHandler
(ctx *fiber.Ctx, err error)
internal/app/server/middleware/error.go:26
Function
First
First returns the first non-nil ptr it is passed.
internal/pkg/ptr/first.go:4
Method
Health
@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
Method
IsExpired
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
Method
Login
@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
Function
New
New allocates a new variable of a given value and returns a ptr to it.
internal/pkg/ptr/new.go:4
Function
NewDev
NewDev wires up the application in dev mode.
internal/app/server/wire.go:28
Function
NewProd
NewProd wires up the application in prod mode.
internal/app/server/wire.go:112
Function
NewStaging
NewStaging wires up the application in staging mode.
internal/app/server/wire.go:56
Function
NewTest
NewTest wires up the application in test mode.
internal/app/server/wire.go:84
Method
Printf
(format string, v ...interface{})
test/container/container.go:10
Method
Reset
()
internal/provider/cache/fibercache/fibercache.go:55
Method
Return
(err error)
internal/provider/cache/mockcache/mockcache_gen.go:90
Method
Return
(ok bool, err error)
internal/provider/cache/mockcache/mockcache_gen.go:146
Method
Run
(run func(ctx context.Context, keys ...string))
internal/provider/cache/mockcache/mockcache_gen.go:77
Method
Run
(run func(ctx context.Context, key string, value any))
internal/provider/cache/mockcache/mockcache_gen.go:139
Method
Run
(run func(ctx context.Context, origin string, destination string, date time.Time))
internal/provider/flightapi/mockflightapi/mockflightapi_gen.go:84
Method
RunAndReturn
(run func(ctx context.Context, keys ...string) error)
internal/provider/cache/mockcache/mockcache_gen.go:95
Method
RunAndReturn
(run func(ctx context.Context, key string, value any) (bool, error))
internal/provider/cache/mockcache/mockcache_gen.go:151
Method
RunAndReturn
(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