tests

package
v0.0.0-...-dada8fb Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package tests Created by Teocci. Author: teocci@yandex.com on 2021-Aug-29

Index

Constants

View Source
const (
	EnumDefault = iota
	EnumFirst
	EnumSecond
)

Variables

View Source
var Binary = []byte("binary-data")
View Source
var BinaryLarge = bytes.Repeat([]byte("1"), 128*1024)
View Source
var EncodedBinary = base64.StdEncoding.EncodeToString(Binary)
View Source
var EncodedBinaryLarge = base64.StdEncoding.EncodeToString(BinaryLarge)
View Source
var Error = errors.New("error")
View Source
var Int = 10
View Source
var PString = &String
View Source
var String = "string"
View Source
var TypeISlice []TypeI

Functions

This section is empty.

Types

type A

type A struct {
	B
	X int
}

type B

type B struct {
	*A
	Y int
}

type CSVMarshaler

type CSVMarshaler struct {
	Err error
}

func (CSVMarshaler) MarshalCSV

func (m CSVMarshaler) MarshalCSV() ([]byte, error)

type CSVTextMarshaler

type CSVTextMarshaler struct {
	CSVMarshaler
	TextMarshaler
}

type CSVTextUnmarshaler

type CSVTextUnmarshaler struct {
	String string `csv:"string"`
}

func (*CSVTextUnmarshaler) UnmarshalCSV

func (t *CSVTextUnmarshaler) UnmarshalCSV(s []byte) error

func (*CSVTextUnmarshaler) UnmarshalText

func (t *CSVTextUnmarshaler) UnmarshalText(text []byte) error

type CSVUnmarshaler

type CSVUnmarshaler struct {
	String string `csv:"string"`
}

func (*CSVUnmarshaler) UnmarshalCSV

func (t *CSVUnmarshaler) UnmarshalCSV(s []byte) error

type Embedded1

type Embedded1 struct {
	String string  `csv:"string"`
	Float  float64 `csv:"float"`
}

type Embedded10

type Embedded10 struct {
	Embedded11
	Embedded12
	Embedded13
}

type Embedded11

type Embedded11 struct {
	Embedded6
}

type Embedded12

type Embedded12 struct {
	Embedded6
}

type Embedded13

type Embedded13 struct {
	Embedded8
}

type Embedded14

type Embedded14 Embedded3

func (*Embedded14) MarshalCSV

func (e *Embedded14) MarshalCSV() ([]byte, error)

type Embedded15

type Embedded15 Embedded3

func (*Embedded15) MarshalText

func (e *Embedded15) MarshalText() ([]byte, error)

type Embedded16

type Embedded16 struct {
	Bool  bool  `json:"bool"`
	Uint  uint  `csv:"-"`
	Uint8 uint8 `json:"-"`
}

type Embedded17

type Embedded17 struct {
	*Embedded18
}

type Embedded18

type Embedded18 struct {
	X *float64
	Y *float64
}

type Embedded2

type Embedded2 struct {
	Float float64 `csv:"float"`
	Bool  bool    `csv:"bool"`
}

type Embedded3

type Embedded3 map[string]string

func (Embedded3) MarshalCSV

func (e Embedded3) MarshalCSV() ([]byte, error)

func (*Embedded3) UnmarshalCSV

func (e *Embedded3) UnmarshalCSV(s []byte) error

type Embedded4

type Embedded4 interface{}

type Embedded5

type Embedded5 struct {
	Embedded6
	Embedded7
	Embedded8
}

type Embedded6

type Embedded6 struct {
	X int
}

type Embedded7

type Embedded7 Embedded6

type Embedded8

type Embedded8 struct {
	Embedded9
}

type Embedded9

type Embedded9 struct {
	X int
	Y int
}

type EmbeddedPtrUnmarshalers

type EmbeddedPtrUnmarshalers struct {
	*CSVUnmarshaler     `csv:"csv"`
	*TextUnmarshaler    `csv:"text"`
	*CSVTextUnmarshaler `csv:"csv-text"`
}

type EmbeddedUnmarshalers

type EmbeddedUnmarshalers struct {
	CSVUnmarshaler     `csv:"csv"`
	TextUnmarshaler    `csv:"text"`
	CSVTextUnmarshaler `csv:"csv-text"`
}

type Enum

type Enum uint8

func (Enum) MarshalCSV

func (e Enum) MarshalCSV() ([]byte, error)

func (*Enum) UnmarshalCSV

func (e *Enum) UnmarshalCSV(data []byte) error

type EnumType

type EnumType struct {
	Enum Enum `csv:"enum"`
}

type Float

type Float float64

type Inline

type Inline struct {
	J1      TypeJ  `csv:",inline"`
	J2      TypeJ  `csv:"prefix-,inline"`
	String  string `csv:"top-string"`
	String2 string `csv:"STR"`
}

type Inline2

type Inline2 struct {
	S string
	A Inline3 `csv:"A,inline"`
	B Inline3 `csv:",inline"`
}

type Inline3

type Inline3 struct {
	Inline4 `csv:",inline"`
}

type Inline4

type Inline4 struct {
	A string
}

type Inline5

type Inline5 struct {
	A Inline2 `csv:"A,inline"`
	B Inline2 `csv:",inline"`
}

type Inline6

type Inline6 struct {
	A Inline7 `csv:",inline"`
}

type Inline7

type Inline7 struct {
	A *Inline6 `csv:",inline"`
	X int
}

type Inline8

type Inline8 struct {
	F  *Inline4 `csv:"A,inline"`
	AA int
}

type IntStruct

type IntStruct struct {
	Value int
}

func (*IntStruct) Scan

func (i *IntStruct) Scan(state fmt.ScanState, verb rune) error

type InvalidType

type InvalidType struct {
	String struct{}
}

type PtrRecCSVMarshaler

type PtrRecCSVMarshaler int

func (*PtrRecCSVMarshaler) CSV

func (m *PtrRecCSVMarshaler) CSV() ([]byte, error)

func (*PtrRecCSVMarshaler) MarshalCSV

func (m *PtrRecCSVMarshaler) MarshalCSV() ([]byte, error)

type PtrRecTextMarshaler

type PtrRecTextMarshaler int

func (*PtrRecTextMarshaler) MarshalText

func (m *PtrRecTextMarshaler) MarshalText() ([]byte, error)

type TagPriority

type TagPriority struct {
	Foo int
	Bar int `csv:"Foo"`
}

type TextMarshaler

type TextMarshaler struct {
	Err error
}

func (TextMarshaler) MarshalText

func (m TextMarshaler) MarshalText() ([]byte, error)

type TextUnmarshaler

type TextUnmarshaler struct {
	String string `csv:"string"`
}

func (*TextUnmarshaler) UnmarshalText

func (t *TextUnmarshaler) UnmarshalText(text []byte) error

type TypeA

type TypeA struct {
	Embedded1
	String string `csv:"string"`
	Embedded2
	Int int `csv:"int"`
}

type TypeB

type TypeB struct {
	Embedded3 `csv:"json"`
	String    string `csv:"string"`
}

type TypeC

type TypeC struct {
	*Embedded1
	String string `csv:"string"`
}

type TypeD

type TypeD struct {
	*Embedded3 `csv:"json"`
	String     string `csv:"string"`
}

type TypeE

type TypeE struct {
	String **string `csv:"string"`
	Int    *int     `csv:"int"`
}

type TypeF

type TypeF struct {
	Int      int          `csv:"int" custom:"int"`
	Pint     *int         `csv:"pint" custom:"pint"`
	Int8     int8         `csv:"int8" custom:"int8"`
	Pint8    *int8        `csv:"pint8" custom:"pint8"`
	Int16    int16        `csv:"int16" custom:"int16"`
	Pint16   *int16       `csv:"pint16" custom:"pint16"`
	Int32    int32        `csv:"int32" custom:"int32"`
	Pint32   *int32       `csv:"pint32" custom:"pint32"`
	Int64    int64        `csv:"int64" custom:"int64"`
	Pint64   *int64       `csv:"pint64" custom:"pint64"`
	UInt     uint         `csv:"uint" custom:"uint"`
	Puint    *uint        `csv:"puint" custom:"puint"`
	Uint8    uint8        `csv:"uint8" custom:"uint8"`
	Puint8   *uint8       `csv:"puint8" custom:"puint8"`
	Uint16   uint16       `csv:"uint16" custom:"uint16"`
	Puint16  *uint16      `csv:"puint16" custom:"puint16"`
	Uint32   uint32       `csv:"uint32" custom:"uint32"`
	Puint32  *uint32      `csv:"puint32" custom:"puint32"`
	Uint64   uint64       `csv:"uint64" custom:"uint64"`
	Puint64  *uint64      `csv:"puint64" custom:"puint64"`
	Float32  float32      `csv:"float32" custom:"float32"`
	Pfloat32 *float32     `csv:"pfloat32" custom:"pfloat32"`
	Float64  float64      `csv:"float64" custom:"float64"`
	Pfloat64 *float64     `csv:"pfloat64" custom:"pfloat64"`
	String   string       `csv:"string" custom:"string"`
	PString  *string      `csv:"pstring" custom:"pstring"`
	Bool     bool         `csv:"bool" custom:"bool"`
	Pbool    *bool        `csv:"pbool" custom:"pbool"`
	V        interface{}  `csv:"interface" custom:"interface"`
	Pv       *interface{} `csv:"pinterface" custom:"pinterface"`
	Binary   []byte       `csv:"binary" custom:"binary"`
	PBinary  *[]byte      `csv:"pbinary" custom:"pbinary"`
}

type TypeG

type TypeG struct {
	String string
	Int    int
	Float  float64 `csv:"-"`
	// contains filtered or unexported fields
}

type TypeH

type TypeH struct {
	Int     int         `csv:"int,omitempty"`
	Int8    int8        `csv:"int8,omitempty"`
	Int16   int16       `csv:"int16,omitempty"`
	Int32   int32       `csv:"int32,omitempty"`
	Int64   int64       `csv:"int64,omitempty"`
	UInt    uint        `csv:"uint,omitempty"`
	Uint8   uint8       `csv:"uint8,omitempty"`
	Uint16  uint16      `csv:"uint16,omitempty"`
	Uint32  uint32      `csv:"uint32,omitempty"`
	Uint64  uint64      `csv:"uint64,omitempty"`
	Float32 float32     `csv:"float32,omitempty"`
	Float64 float64     `csv:"float64,omitempty"`
	String  string      `csv:"string,omitempty"`
	Bool    bool        `csv:"bool,omitempty"`
	V       interface{} `csv:"interface,omitempty"`
}

type TypeI

type TypeI struct {
	String string `csv:",omitempty"`
	Int    int    `csv:"int,omitempty"`
}

type TypeJ

type TypeJ struct {
	String string `csv:"STR" json:"string"`
	Int    string `csv:"int" json:"-"`
	Embedded16
	Float string `csv:"float"`
}

type TypeK

type TypeK struct {
	*TypeL
}

type TypeL

type TypeL struct {
	String string
	Int    int `csv:",omitempty"`
}

type TypeM

type TypeM struct {
	*TextMarshaler `csv:"text"`
}

type TypeWithInvalidField

type TypeWithInvalidField struct {
	String TypeI `csv:"string"`
}

type UnexportedEmbedded

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

type UnexportedEmbeddedPtr

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

type Unmarshalers

type Unmarshalers struct {
	CSVUnmarshaler      CSVUnmarshaler      `csv:"csv"`
	PCSVUnmarshaler     *CSVUnmarshaler     `csv:"pcsv"`
	TextUnmarshaler     TextUnmarshaler     `csv:"text"`
	PTextUnmarshaler    *TextUnmarshaler    `csv:"ptext"`
	CSVTextUnmarshaler  CSVTextUnmarshaler  `csv:"csv-text"`
	PCSVTextUnmarshaler *CSVTextUnmarshaler `csv:"pcsv-text"`
}

type ValueRecTextUnmarshaler

type ValueRecTextUnmarshaler struct {
	S *string
}

func (ValueRecTextUnmarshaler) UnmarshalText

func (u ValueRecTextUnmarshaler) UnmarshalText(text []byte) error

type ValueRecUnmarshaler

type ValueRecUnmarshaler struct {
	S *string
}

func (ValueRecUnmarshaler) Scan

func (u ValueRecUnmarshaler) Scan(data []byte) error

func (ValueRecUnmarshaler) UnmarshalCSV

func (u ValueRecUnmarshaler) UnmarshalCSV(data []byte) error

Jump to

Keyboard shortcuts

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