openai

package
v1.10.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultErrorAccumulator

type DefaultErrorAccumulator struct {
	Buffer errorBuffer
}

func (*DefaultErrorAccumulator) Bytes

func (e *DefaultErrorAccumulator) Bytes() (errBytes []byte)

func (*DefaultErrorAccumulator) Write

func (e *DefaultErrorAccumulator) Write(p []byte) error

type DefaultFormBuilder

type DefaultFormBuilder struct {
	// contains filtered or unexported fields
}

func NewFormBuilder

func NewFormBuilder(body io.Writer) *DefaultFormBuilder

func (*DefaultFormBuilder) Close

func (fb *DefaultFormBuilder) Close() error

func (*DefaultFormBuilder) CreateFormFile

func (fb *DefaultFormBuilder) CreateFormFile(fieldname string, file *os.File) error

func (*DefaultFormBuilder) CreateFormFileReader

func (fb *DefaultFormBuilder) CreateFormFileReader(fieldname string, r io.Reader, filename string) error

func (*DefaultFormBuilder) FormDataContentType

func (fb *DefaultFormBuilder) FormDataContentType() string

func (*DefaultFormBuilder) WriteField

func (fb *DefaultFormBuilder) WriteField(fieldname, value string) error

type ErrorAccumulator

type ErrorAccumulator interface {
	Write(p []byte) error
	Bytes() []byte
}

func NewErrorAccumulator

func NewErrorAccumulator() ErrorAccumulator

type FormBuilder

type FormBuilder interface {
	CreateFormFile(fieldname string, file *os.File) error
	CreateFormFileReader(fieldname string, r io.Reader, filename string) error
	WriteField(fieldname, value string) error
	Close() error
	FormDataContentType() string
}

type HTTPRequestBuilder

type HTTPRequestBuilder struct {
	// contains filtered or unexported fields
}

func NewRequestBuilder

func NewRequestBuilder() *HTTPRequestBuilder

func (*HTTPRequestBuilder) Build

func (b *HTTPRequestBuilder) Build(ctx context.Context, method, url string, request any) (*http.Request, error)

type JSONMarshaller

type JSONMarshaller struct{}

func (*JSONMarshaller) Marshal

func (jm *JSONMarshaller) Marshal(value any) ([]byte, error)

type JSONUnmarshaler

type JSONUnmarshaler struct{}

func (*JSONUnmarshaler) Unmarshal

func (jm *JSONUnmarshaler) Unmarshal(data []byte, v any) error

type Marshaller

type Marshaller interface {
	Marshal(value any) ([]byte, error)
}

type RequestBuilder

type RequestBuilder interface {
	Build(ctx context.Context, method, url string, request any) (*http.Request, error)
}

type Unmarshaler

type Unmarshaler interface {
	Unmarshal(data []byte, v any) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL