Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheOptions ¶
type CacheOptions struct {
// TTL is how long a successful lookup is kept in the cache.
// Defaults to 60 seconds.
TTL time.Duration
// Capacity is the maximum number of entries in the cache.
// Defaults to 2048.
Capacity uint64
}
CacheOptions configures the TTNINJS document cache.
type Media ¶
type Media struct {
// contains filtered or unexported fields
}
func NewMedia ¶
func NewMedia(opts MediaOptions) *Media
type MediaOptions ¶
type MediaOptions struct {
Logger *slog.Logger
Client *http.Client
Host string
// Cache enables TTNINJS document caching. If nil, no caching is performed.
Cache *CacheOptions
}
MediaOptions configures the Media client.
type TTNINJSErrorCause ¶
type TTNINJSErrorCause string
const ( TTNINJSErrorCauseNotFound TTNINJSErrorCause = "not_found" TTNINJSErrorCauseInvalidURI TTNINJSErrorCause = "invalid_uri" TTNINJSErrorCauseInvalidDoc TTNINJSErrorCause = "invalid_doc" TTNINJSErrorCauseInvalidBody TTNINJSErrorCause = "invalid_body" )
type TTNINJSPermanentError ¶
type TTNINJSPermanentError struct {
Cause TTNINJSErrorCause
}
func (TTNINJSPermanentError) Error ¶
func (err TTNINJSPermanentError) Error() string
Click to show internal directories.
Click to hide internal directories.