Documentation ¶
Overview ¶
package text provides a common interface for different mechanisms to derive texts for images.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AvailableTexts ¶
func AvailableTexts() []string
AvailableText returns the list of schemes that have been registered with `TextInitializeFunc` functions.
func PrepareText ¶
func RegisterText ¶
func RegisterText(ctx context.Context, name string, fn TextInitializeFunc) error
RegisterText associates a URI scheme with a `TextInitializeFunc` initialization function.
Types ¶
type JsonText ¶
type JsonText struct { Text // contains filtered or unexported fields }
type JsonText implements the `Text` interface and returns empty text strings.
type Text ¶
type Text interface { // Text produces a text derived from a file contained in a gocloud.dev/blob Bucket instance. Body(context.Context, *blob.Bucket, string) (string, error) }
type Text provides a common interface for different mechanisms to derive texts for images.
func NewJsonText ¶
NewJsonText return a new instance of `JsonText` for 'url'
type TextInitializeFunc ¶
type TextInitializeFunc defined a common initialization function for instances implementing the Text interface. This is specified when the packages definining those instances call `RegisterText` and invoked with the `NewText` method is called.