sttp.tapir.files

Members list

Type members

Classlikes

object Files

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Files.type
case class FilesOptions[F[_]](calculateETag: MonadError[F] => Option[RangeValue] => URL => F[Option[ETag]], fileFilter: List[String] => Boolean, useGzippedIfAvailable: Boolean, defaultFile: Option[List[String]])

Value parameters

defaultFile

path segments (relative to the system path from which files are read) of the file to return in case the one requested by the user isn't found. This is useful for SPA apps, where the same main application file needs to be returned regardless of the path.

fileFilter

A file will be exposed only if this function returns true.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object FilesOptions

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object Resources

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Resources.type

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object BadRequest.type
object NotFound.type
object RangeNotSatisfiable.type

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class StaticInput(path: List[String], ifNoneMatch: Option[List[ETag]], ifModifiedSince: Option[Instant], range: Option[Range], acceptEncoding: List[String])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait StaticOutput[+T]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Found[T]
class FoundPartial[T]
object NotModified.type
object StaticOutput

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Static content endpoints, including files and resources.

Static content endpoints, including files and resources.

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def defaultETag(lastModified: Long, range: Option[RangeValue], length: Long): ETag

Inherited methods

def staticFileGetServerEndpoint[F[_]](prefix: EndpointInput[Unit])(systemPath: String): ServerEndpoint[Any, F]

A server endpoint, which exposes a single file from local storage found at systemPath, using the given path.

A server endpoint, which exposes a single file from local storage found at systemPath, using the given path.

staticFileGetServerEndpoint("static" / "hello.html")("/home/app/static/data.html")

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticFilesGetEndpoint(prefix: EndpointInput[Unit]): PublicEndpoint[StaticInput, StaticErrorOutput, StaticOutput[FileRange], Any]

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticFilesGetServerEndpoint[F[_]](prefix: EndpointInput[Unit])(systemPath: String, options: FilesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, which exposes files from local storage found at systemPath, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

A server endpoint, which exposes files from local storage found at systemPath, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

staticFilesGetServerEndpoint("static" / "files")("/home/app/static")

A request to /static/files/css/styles.css will try to read the /home/app/static/css/styles.css file.

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticFilesHeadServerEndpoint[F[_]](prefix: EndpointInput[Unit])(systemPath: String, options: FilesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, used to verify if sever supports range requests for file under particular path Additionally it verify file existence and returns its size

A server endpoint, used to verify if sever supports range requests for file under particular path Additionally it verify file existence and returns its size

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticFilesServerEndpoints[F[_]](prefix: EndpointInput[Unit])(systemPath: String, options: FilesOptions[F]): List[ServerEndpoint[Any, F]]

Create a pair of endpoints (head, get) for exposing files from local storage found at systemPath, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

Create a pair of endpoints (head, get) for exposing files from local storage found at systemPath, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

staticFilesServerEndpoints("static" / "files")("/home/app/static")

A request to /static/files/css/styles.css will try to read the /home/app/static/css/styles.css file.

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticResourceGetServerEndpoint[F[_]](prefix: EndpointInput[Unit])(classLoader: ClassLoader, resourcePath: String, options: FilesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, which exposes a single resource available from the given classLoader at resourcePath, using the given path.

A server endpoint, which exposes a single resource available from the given classLoader at resourcePath, using the given path.

staticResourceGetServerEndpoint("static" / "hello.html")(classOf[App].getClassLoader, "app/data.html")

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticResourcesGetEndpoint(prefix: EndpointInput[Unit]): PublicEndpoint[StaticInput, StaticErrorOutput, StaticOutput[InputStreamRange], Any]

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticResourcesGetServerEndpoint[F[_]](prefix: EndpointInput[Unit])(classLoader: ClassLoader, resourcePrefix: String, options: FilesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, which exposes resources available from the given classLoader, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

A server endpoint, which exposes resources available from the given classLoader, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

staticResourcesGetServerEndpoint("static" / "files")(classOf[App].getClassLoader, "app")

A request to /static/files/css/styles.css will try to read the /app/css/styles.css resource.

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticResourcesHeadServerEndpoint[F[_]](prefix: EndpointInput[Unit])(classLoader: ClassLoader, resourcePath: String, options: FilesOptions[F]): ServerEndpoint[Any, F]

A server endpoint, which can be used to verify the existence of a resource under given path.

A server endpoint, which can be used to verify the existence of a resource under given path.

Attributes

Inherited from:
TapirStaticContentEndpoints
def staticResourcesServerEndpoints[F[_]](prefix: EndpointInput[Unit])(classLoader: ClassLoader, resourcePath: String, options: FilesOptions[F]): List[ServerEndpoint[Any, F]]

Create a pair of endpoints (head, get) for exposing resources available from the given classLoader, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

Create a pair of endpoints (head, get) for exposing resources available from the given classLoader, using the given prefix. Typically, the prefix is a path, but it can also contain other inputs. For example:

resourcesServerEndpoints("static" / "files")(classOf[App].getClassLoader, "app")

A request to /static/files/css/styles.css will try to read the /app/css/styles.css resource.

Attributes

Inherited from:
TapirStaticContentEndpoints

Inherited fields

lazy val staticFilesGetEndpoint: PublicEndpoint[StaticInput, StaticErrorOutput, StaticOutput[FileRange], Any]

Attributes

Inherited from:
TapirStaticContentEndpoints
lazy val staticResourcesGetEndpoint: PublicEndpoint[StaticInput, StaticErrorOutput, StaticOutput[InputStreamRange], Any]

Attributes

Inherited from:
TapirStaticContentEndpoints