internal

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EncodingBase64 is base64 encoding for the data url
	EncodingBase64 = "base64"
	// EncodingASCII is ascii encoding for the data url
	EncodingASCII = "ascii"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataURI

type DataURI struct {
	MediaType  string
	Parameters map[string]string
	Data       string
}

DataURI represents the Data URI scheme

func DecodeDataURI

func DecodeDataURI(input string) (*DataURI, error)

DecodeDataURI decodes data URI scheme data:[<media type>][;<key>=<value>][;<extension>],<data>

type Key

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

Key represents a key string or index

func NewIndexKey

func NewIndexKey(index int) Key

NewIndexKey creates an index key

func NewKey

func NewKey(key string) Key

NewKey creates a string key

func (Key) Index

func (k Key) Index() *int

Index gets the integer key

func (Key) IsEmpty

func (k Key) IsEmpty() bool

IsEmpty checks if the key is empty

func (Key) Key

func (k Key) Key() string

Key gets the string key

func (Key) String

func (k Key) String() string

String implements fmt.Stringer interface

type Keys

type Keys []Key

Keys represent a key slice

func (Keys) String

func (ks Keys) String() string

String implements fmt.Stringer interface

type MultipartWriter

type MultipartWriter struct {
	*multipart.Writer
}

MultipartWriter extends multipart.Writer with helpers

func NewMultipartWriter

func NewMultipartWriter(w io.Writer) *MultipartWriter

NewMultipartWriter creates a MultipartWriter instance

func (*MultipartWriter) WriteDataURI

func (w *MultipartWriter) WriteDataURI(name string, value any, headers http.Header) error

WriteDataURI write a file from data URI string

func (*MultipartWriter) WriteField

func (w *MultipartWriter) WriteField(fieldName, value string, headers http.Header) error

WriteField calls CreateFormField and then writes the given value.

func (*MultipartWriter) WriteJSON

func (w *MultipartWriter) WriteJSON(fieldName string, value any, headers http.Header) error

WriteField calls CreateFormField and then writes the given value with json encoding.

type ParameterItem

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

ParameterItem represents the key-value slice pair

func NewParameterItem

func NewParameterItem(keys Keys, values []string) ParameterItem

NewParameterItem creates a parameter value pair

func (*ParameterItem) Add

func (ssp *ParameterItem) Add(key Key, value string)

func (*ParameterItem) AddKey

func (ssp *ParameterItem) AddKey(key Key)

func (*ParameterItem) AddKeys

func (ssp *ParameterItem) AddKeys(keys []Key)

func (*ParameterItem) AddValue

func (ssp *ParameterItem) AddValue(value string)

func (*ParameterItem) AddValues

func (ssp *ParameterItem) AddValues(values []string)

func (ParameterItem) Keys

func (ssp ParameterItem) Keys() Keys

Keys returns keys of the parameter item

func (*ParameterItem) PrependKey

func (ssp *ParameterItem) PrependKey(key Key)

func (*ParameterItem) PrependKeys

func (ssp *ParameterItem) PrependKeys(keys []Key)

func (*ParameterItem) PrependValue

func (ssp *ParameterItem) PrependValue(value string)

func (*ParameterItem) PrependValues

func (ssp *ParameterItem) PrependValues(values []string)

func (ParameterItem) String

func (ssp ParameterItem) String() string

String implements fmt.Stringer interface

func (ParameterItem) Values

func (ssp ParameterItem) Values() []string

type ParameterItems

type ParameterItems []ParameterItem

func (*ParameterItems) Add

func (ssp *ParameterItems) Add(keys []Key, values []string)

func (ParameterItems) Find

func (ssp ParameterItems) Find(keys []Key) *ParameterItem

func (ParameterItems) FindDefault

func (ssp ParameterItems) FindDefault() *ParameterItem

func (ParameterItems) FindIndex

func (ssp ParameterItems) FindIndex(keys []Key) int

func (ParameterItems) String

func (ssp ParameterItems) String() string

String implements fmt.Stringer interface

Jump to

Keyboard shortcuts

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