Documentation ¶
Index ¶
- func CreateImageFormFile(w *multipart.Writer, name, filename string) (io.Writer, error)
- func RegisterEmbosser(ctx context.Context, scheme string, init_func EmbosserInitializationFunc) error
- func Schemes() []string
- type EmbossTextResult
- type Embosser
- func NewEmbosser(ctx context.Context, uri string) (Embosser, error)
- func NewGrpcEmbosser(ctx context.Context, uri string) (Embosser, error)
- func NewHTTPEmbosser(ctx context.Context, uri string) (Embosser, error)
- func NewHTTPEmbosserWithClient(ctx context.Context, uri string, client *http.Client) (Embosser, error)
- func NewLocalEmbosser(ctx context.Context, uri string) (Embosser, error)
- func NewNullEmbosser(ctx context.Context, uri string) (Embosser, error)
- type EmbosserInitializationFunc
- type GrpcEmbosser
- type HTTPEmbosser
- type LocalEmbosser
- type NullEmbosser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateImageFormFile ¶
func RegisterEmbosser ¶
func RegisterEmbosser(ctx context.Context, scheme string, init_func EmbosserInitializationFunc) error
RegisterEmbosser registers 'scheme' as a key pointing to 'init_func' in an internal lookup table used to create new `Embosser` instances by the `NewEmbosser` method.
Types ¶
type EmbossTextResult ¶ added in v0.0.8
type EmbossTextResult struct { Text string `json:"text"` Source string `json:"source"` Created int64 `json:"created"` }
func (*EmbossTextResult) String ¶ added in v0.0.8
func (r *EmbossTextResult) String() string
type Embosser ¶
type Embosser interface { EmbossText(context.Context, string) (*EmbossTextResult, error) EmbossTextWithReader(context.Context, string, io.Reader) (*EmbossTextResult, error) Close(context.Context) error }
func NewEmbosser ¶
NewEmbosser returns a new `Embosser` instance configured by 'uri'. The value of 'uri' is parsed as a `url.URL` and its scheme is used as the key for a corresponding `EmbosserInitializationFunc` function used to instantiate the new `Embosser`. It is assumed that the scheme (and initialization function) have been registered by the `RegisterEmbosser` method.
func NewGrpcEmbosser ¶ added in v0.0.5
func NewHTTPEmbosser ¶ added in v0.0.4
func NewHTTPEmbosserWithClient ¶ added in v0.0.4
type EmbosserInitializationFunc ¶
EmbosserInitializationFunc is a function defined by individual embosser package and used to create an instance of that embosser
type GrpcEmbosser ¶ added in v0.0.5
type GrpcEmbosser struct {
// contains filtered or unexported fields
}
func (*GrpcEmbosser) Close ¶ added in v0.0.5
func (e *GrpcEmbosser) Close(ctx context.Context) error
func (*GrpcEmbosser) EmbossText ¶ added in v0.0.5
func (e *GrpcEmbosser) EmbossText(ctx context.Context, path string) (*EmbossTextResult, error)
func (*GrpcEmbosser) EmbossTextWithReader ¶ added in v0.0.5
func (e *GrpcEmbosser) EmbossTextWithReader(ctx context.Context, path string, im_r io.Reader) (*EmbossTextResult, error)
type HTTPEmbosser ¶ added in v0.0.4
type HTTPEmbosser struct {
// contains filtered or unexported fields
}
func (*HTTPEmbosser) Close ¶ added in v0.0.5
func (e *HTTPEmbosser) Close(ctx context.Context) error
func (*HTTPEmbosser) EmbossText ¶ added in v0.0.4
func (e *HTTPEmbosser) EmbossText(ctx context.Context, path string) (*EmbossTextResult, error)
func (*HTTPEmbosser) EmbossTextWithReader ¶ added in v0.0.4
func (e *HTTPEmbosser) EmbossTextWithReader(ctx context.Context, path string, im_r io.Reader) (*EmbossTextResult, error)
type LocalEmbosser ¶
type LocalEmbosser struct {
// contains filtered or unexported fields
}
func (*LocalEmbosser) Close ¶ added in v0.0.5
func (e *LocalEmbosser) Close(ctx context.Context) error
func (*LocalEmbosser) EmbossText ¶
func (e *LocalEmbosser) EmbossText(ctx context.Context, path string) (*EmbossTextResult, error)
func (*LocalEmbosser) EmbossTextWithReader ¶ added in v0.0.2
func (e *LocalEmbosser) EmbossTextWithReader(ctx context.Context, path string, r io.Reader) (*EmbossTextResult, error)
type NullEmbosser ¶ added in v0.0.3
type NullEmbosser struct {
// contains filtered or unexported fields
}
func (*NullEmbosser) Close ¶ added in v0.0.5
func (e *NullEmbosser) Close(ctx context.Context) error
func (*NullEmbosser) EmbossText ¶ added in v0.0.3
func (e *NullEmbosser) EmbossText(ctx context.Context, path string) (*EmbossTextResult, error)
func (*NullEmbosser) EmbossTextWithReader ¶ added in v0.0.3
func (e *NullEmbosser) EmbossTextWithReader(ctx context.Context, path string, r io.Reader) (*EmbossTextResult, error)