Documentation ¶
Overview ¶
Package restapi REST API FrostFS
REST API for native integration with FrostFS. Schemes: http Host: localhost:8090 BasePath: /v1 Version: v1 Consumes: - application/json Produces: - application/json
swagger:meta
Index ¶
- Constants
- Variables
- func BindDefaultFlags(flagSet *pflag.FlagSet)
- type Server
- func (s *Server) ConfigureAPI(fn func(*operations.FrostfsRestGwAPI) http.Handler)
- func (s *Server) ConfigureServer(cfgServer func(s *http.Server, scheme, addr string))
- func (s *Server) ConfigureTLS(cfgTLS func(tlsConfig *tls.Config))
- func (s *Server) Fatalf(f string, args ...interface{})
- func (s *Server) GetHandler() http.Handler
- func (s *Server) HTTPListener() (net.Listener, error)
- func (s *Server) Listen() error
- func (s *Server) Logf(f string, args ...interface{})
- func (s *Server) Serve() (err error)
- func (s *Server) SetHandler(handler http.Handler)
- func (s *Server) Shutdown() error
- func (s *Server) TLSListener() (net.Listener, error)
- type ServerConfig
Constants ¶
const ( FlagScheme = "scheme" FlagCleanupTimeout = "cleanup-timeout" FlagGracefulTimeout = "graceful-timeout" FlagMaxHeaderSize = "max-header-size" FlagListenAddress = "listen-address" FlagListenLimit = "listen-limit" FlagKeepAlive = "keep-alive" FlagReadTimeout = "read-timeout" FlagWriteTimeout = "write-timeout" FlagTLSListenAddress = "tls-listen-address" FlagTLSCertificate = "tls-certificate" FlagTLSKey = "tls-key" FlagTLSCa = "tls-ca" FlagTLSListenLimit = "tls-listen-limit" FlagTLSKeepAlive = "tls-keep-alive" FlagTLSReadTimeout = "tls-read-timeout" FlagTLSWriteTimeout = "tls-write-timeout" )
Variables ¶
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 BindDefaultFlags ¶
BindDefaultFlag init default flag.
Types ¶
type Server ¶
type Server struct { EnabledListeners []string CleanupTimeout time.Duration GracefulTimeout time.Duration MaxHeaderSize int ListenAddress string ListenLimit int KeepAlive time.Duration ReadTimeout time.Duration WriteTimeout time.Duration TLSListenAddress string TLSCertificate string TLSCertificateKey string TLSCACertificate string TLSListenLimit int TLSKeepAlive time.Duration TLSReadTimeout time.Duration TLSWriteTimeout time.Duration // contains filtered or unexported fields }
Server for the frostfs rest gw API
func NewServer ¶
func NewServer(api *operations.FrostfsRestGwAPI, cfg *ServerConfig) *Server
NewServer creates a new api frostfs rest gw server but does not configure it
func (*Server) ConfigureAPI ¶
func (s *Server) ConfigureAPI(fn func(*operations.FrostfsRestGwAPI) http.Handler)
ConfigureAPI configures the API and handlers.
func (*Server) ConfigureServer ¶
As soon as server is initialized but not run yet, this function will be called. If you need to modify a config, store server instance to stop it individually later, this is the place. This function can be called multiple times, depending on the number of serving schemes. scheme value will be set accordingly: "http", "https" or "unix".
func (*Server) ConfigureTLS ¶
The TLS configuration before HTTPS server starts.
func (*Server) Fatalf ¶
Fatalf logs message either via defined user logger or via system one if no user logger is defined. Exits with non-zero status after printing
func (*Server) GetHandler ¶
GetHandler returns a handler useful for testing
func (*Server) HTTPListener ¶
HTTPListener returns the http listener
func (*Server) Logf ¶
Logf logs message either via defined user logger or via system one if no user logger is defined.
func (*Server) SetHandler ¶
SetHandler allows for setting a http handler on this server
type ServerConfig ¶
type ServerConfig struct { EnabledListeners []string CleanupTimeout time.Duration GracefulTimeout time.Duration MaxHeaderSize int ListenAddress string ListenLimit int KeepAlive time.Duration ReadTimeout time.Duration WriteTimeout time.Duration TLSListenAddress string TLSListenLimit int TLSKeepAlive time.Duration TLSReadTimeout time.Duration TLSWriteTimeout time.Duration TLSCertificate string TLSCertificateKey string TLSCACertificate string SuccessfulStartCallback func() }