Documentation
¶
Overview ¶
Package restapi Payments API Payments API as specified in Form3 take home test
Schemes: http Host: api.example.com BasePath: /v1 Version: 1 Consumes: - application/vnd.api+json Produces: - application/vnd.api+json
swagger:meta
Index ¶
Constants ¶
View Source
const AuthKey contextKey = "Auth"
Variables ¶
View Source
var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage )
Functions ¶
func Handler ¶
Handler returns an http.Handler given the handler configuration It mounts all the business logic implementers in the right routing.
func HandlerAPI ¶
func HandlerAPI(c Config) (http.Handler, *operations.PaymentsAPI, error)
HandlerAPI returns an http.Handler given the handler configuration and the corresponding *Payments instance. It mounts all the business logic implementers in the right routing.
Types ¶
type Config ¶
type Config struct { PaymentsAPI Logger func(string, ...interface{}) // InnerMiddleware is for the handler executors. These do not apply to the swagger.json document. // The middleware executes after routing but before authentication, binding and validation InnerMiddleware func(http.Handler) http.Handler // Authorizer is used to authorize a request after the Auth function was called using the "Auth*" functions // and the principal was stored in the context in the "AuthKey" context value. Authorizer func(*http.Request) error }
Config is configuration for Handler
type PaymentsAPI ¶
type PaymentsAPI interface { CreatePayment(ctx context.Context, params payments.CreatePaymentParams) middleware.Responder DeletePayment(ctx context.Context, params payments.DeletePaymentParams) middleware.Responder GetPayment(ctx context.Context, params payments.GetPaymentParams) middleware.Responder ListPayments(ctx context.Context, params payments.ListPaymentsParams) middleware.Responder UpdatePayment(ctx context.Context, params payments.UpdatePaymentParams) middleware.Responder }
PaymentsAPI
Click to show internal directories.
Click to hide internal directories.