{"modulePath":"github.com/theopenlane/openlane-cloud","version":"v0.1.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package server\n\nPackage server contains the server functions\n\n## Variables\n\n```go\nvar (\n\t// ErrCertFileMissing is returned when https is enabled but no cert file is provided\n\tErrCertFileMissing = errors.New(\"no cert file found\")\n\n\t// ErrKeyFileMissing is returned when https is enabled but no key file is provided\n\tErrKeyFileMissing = errors.New(\"no key file found\")\n)\n```\n\n## Functions\n\n```go\nfunc NewOpenAPISpec() (*openapi3.T, error)\n```\nNewOpenAPISpec creates a new OpenAPI 3.1.0 specification based on the configured go interfaces and the operation types appended within the individual handlers\n\n```go\nfunc NewRouter() (*route.Router, error)\n```\nNewRouter creates a wrapper router so that the echo server and OAS specification can be generated simultaneously\n\n## Types\n\n```go\ntype APIKey struct {\n\tName string\n}\n```\nAPIKey is a struct that represents an API Key security scheme\n\n```go\nfunc (k *APIKey) Scheme() *openapi3.SecurityScheme\n```\nScheme returns the API Key security scheme\n\n```go\ntype Basic struct {\n\tUsername string\n\tPassword string\n}\n```\nBasic is a struct that represents a Basic Auth security scheme\n\n```go\nfunc (b *Basic) Scheme() *openapi3.SecurityScheme\n```\nScheme returns the Basic Auth security scheme\n\n```go\ntype OAuth2 struct {\n\tAuthorizationURL string\n\tTokenURL         string\n\tRefreshURL       string\n\tScopes           map[string]string\n}\n```\nOAuth2 is a struct that represents an OAuth2 security scheme\n\n```go\nfunc (i *OAuth2) Scheme() *openapi3.SecurityScheme\n```\nScheme returns the OAuth2 security scheme\n\n```go\ntype OpenID struct {\n\tConnectURL string\n}\n```\nOpenID is a struct that represents an OpenID Connect security scheme\n\n```go\nfunc (i *OpenID) Scheme() *openapi3.SecurityScheme\n```\nScheme returns the OpenID Connect security scheme\n\n```go\ntype Server struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewServer(c config.Config) *Server\n```\nNewServer returns a new Server configuration\n\n```go\nfunc (s *Server) AddHandler(r handler)\n```\nAddHandler provides the ability to add additional HTTP handlers that process requests. The handler that is provided should have a Routes(\\*echo.Group) function, which allows the routes to be added to the server.\n\n```go\nfunc (s *Server) StartEchoServer(ctx context.Context) error\n```\nStartEchoServer creates and starts the echo server with configured middleware and handlers\n\n","path":"github.com/theopenlane/openlane-cloud/internal/httpserve/server","name":"server","synopsis":"Package server contains the server functions","isRedistributable":true}
