Documentation
¶
Index ¶
- Constants
- func ApplyComp[T any](c *T, modifiers ...CompOption[T]) T
- func ApplyMeta[T any](m *T, modifiers ...MetaOption[T]) T
- type CompOption
- type FSysFileReader
- type Geocoder
- type GzipReader
- type GzipUtil
- type GzipWriter
- type HTTPDoer
- type HTTPRequester
- type HTTPWriter
- type JSONOption
- type JSONOptions
- type Level
- type Logger
- type MapsAPI
- type Marshaler
- type MetaOption
- type Reader
- type RequestOption
- type RequestOptions
- type Tool
- type ToolOption
- type ToolOptions
- type Unmarshaler
Constants ¶
View Source
const DefaultIndent = " "
Variables ¶
This section is empty.
Functions ¶
func ApplyComp ¶
func ApplyComp[T any](c *T, modifiers ...CompOption[T]) T
func ApplyMeta ¶
func ApplyMeta[T any](m *T, modifiers ...MetaOption[T]) T
Types ¶
type CompOption ¶
type CompOption[T any] func(*T)
type FSysFileReader ¶
type FSysFileReader interface {
FSysReadFile(fsys fs.ReadFileFS, path string) ([]byte, error)
}
type Geocoder ¶
type Geocoder interface {
TimezoneFromCoordinates(ctx context.Context, latitude, longitude float64) (string, error)
CityFromCoordinates(ctx context.Context, latitude, longitude float64) (string, error)
SwapTimezone(t time.Time, tz string, toUTC, toMidnight bool) (time.Time, error)
IsUTC(t time.Time) bool
}
type HTTPRequester ¶
type HTTPWriter ¶
type HTTPWriter interface {
Write(w http.ResponseWriter, b []byte) (int, error)
}
type JSONOption ¶
type JSONOption func(*JSONOptions)
func WithJSONEscapeHTML ¶
func WithJSONEscapeHTML(escape bool) JSONOption
func WithJSONIndent ¶
func WithJSONIndent(indent string) JSONOption
func WithJSONUseNumber ¶
func WithJSONUseNumber(use bool) JSONOption
type JSONOptions ¶
type JSONOptions struct {
Indent string // Enables indentation if non-empty.
EscapeHTML bool // Determines if HTML characters should be escaped.
UseNumber bool // If true, decodes numbers as `json.Number` instead of `float64`.
}
JSONOptions defines settings for encoding/decoding.
func ApplyJSONOptions ¶
func ApplyJSONOptions(opts *JSONOptions, modifiers ...JSONOption) JSONOptions
type MapsAPI ¶
type MapsAPI interface {
Timezone(ctx context.Context, r *maps.TimezoneRequest) (*maps.TimezoneResult, error)
Geocode(ctx context.Context, r *maps.GeocodingRequest) ([]maps.GeocodingResult, error)
}
type MetaOption ¶
type MetaOption[T any] func(*T)
type RequestOption ¶
type RequestOption func(*RequestOptions)
func WithRequestBody ¶
func WithRequestBody(body io.Reader) RequestOption
func WithRequestHeader ¶
func WithRequestHeader(header http.Header) RequestOption
type RequestOptions ¶
func ApplyRequestOptions ¶
func ApplyRequestOptions(opts *RequestOptions, modifiers ...RequestOption) RequestOptions
type ToolOption ¶
type ToolOption[C any] func(*ToolOptions[C])
func WithLogger ¶
func WithLogger[C any](l Logger) ToolOption[C]
type ToolOptions ¶
func ApplyOptions ¶
func ApplyOptions[C any](opts *ToolOptions[C], modifiers ...ToolOption[C]) ToolOptions[C]
type Unmarshaler ¶
type Unmarshaler interface {
Unmarshal(data io.Reader, v any, opts JSONOptions) error
}
Click to show internal directories.
Click to hide internal directories.