// Code generated by ogen, DO NOT EDIT. package oas import ( "context" ) // Handler handles operations described by OpenAPI v3 specification. type Handler interface { // CreateShortURL implements createShortURL operation. // // Create a shorten URL. // // POST /create CreateShortURL(ctx context.Context, req *CreateShortURLReq) (CreateShortURLRes, error) // RedirectLongURL implements redirectLongURL operation. // // Redirect client to long URL. // // GET /{hash} RedirectLongURL(ctx context.Context, params RedirectLongURLParams) (RedirectLongURLRes, error) } // Server implements http server based on OpenAPI v3 specification and // calls Handler to handle requests. type Server struct { h Handler baseServer } // NewServer creates new Server. func NewServer(h Handler, opts ...ServerOption) (*Server, error) { s, err := newServerConfig(opts...).baseServer() if err != nil { return nil, err } return &Server{ h: h, baseServer: s, }, nil }