example

package
v0.0.0-...-519d24f Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Code generated by github.com/yssk22/go/generator DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Example

type Example struct {
	BoolVal   bool       `json:"bool_val"`
	BoolPtr   *bool      `json:"bool_ptr"`
	IntVaL    int        `json:"int_val"`
	IntPtr    *int       `json:"int_ptr"`
	FloatVal  float64    `json:"float_val"`
	FloatPtr  *float64   `json:"float_ptr"`
	StringVal string     `json:"string_val"`
	StringPtr *string    `json:"string_ptr"`
	TimeVal   time.Time  `json:"time_val"`
	TimePtr   *time.Time `json:"time_ptr"`
	InnerVal  Inner      `json:"inner_val"`
	InnerPtr  *Inner     `json:"inner_ptr"`
	Imported  types.RGB  `json:"rgb"`
	EnumVal   MyEnum     `json:"enum_value"`
	EnumPtr   *MyEnum    `json:"enum_ptr"`
}

Example to test struct @flow

type Inner

type Inner struct {
	BoolVal   bool       `json:"bool_val"`
	BoolPtr   *bool      `json:"bool_ptr"`
	IntVaL    int        `json:"int_val"`
	IntPtr    *int       `json:"int_ptr"`
	FloatVal  float64    `json:"float_val"`
	FloatPtr  *float64   `json:"float_ptr"`
	StringVal string     `json:"string_val"`
	StringPtr *string    `json:"string_ptr"`
	TimeVal   time.Time  `json:"time_val"`
	TimePtr   *time.Time `json:"time_ptr"`
}

Inner to test inner object @flow

type MyEnum

type MyEnum int

MyEnum is an example of enum @enum @flow

const (
	MyEnumA MyEnum = iota
	MyEnumB
)

func MustParseMyEnum

func MustParseMyEnum(s string) MyEnum

func ParseMyEnum

func ParseMyEnum(s string) (MyEnum, error)

func ParseMyEnumOr

func ParseMyEnumOr(s string, or MyEnum) MyEnum

func (MyEnum) IsVaild

func (e MyEnum) IsVaild() bool

func (MyEnum) MarshalJSON

func (e MyEnum) MarshalJSON() ([]byte, error)

func (*MyEnum) Parse

func (e *MyEnum) Parse(s string) error

func (MyEnum) String

func (e MyEnum) String() string

func (*MyEnum) UnmarshalJSON

func (e *MyEnum) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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