Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FactoryState ¶
type FactoryState int
FactoryState は、オブジェクトを生成する関数の戻り値
const ( // None は、オブジェクトが生成されなかったことを示す None FactoryState = iota // Init は、オブジェクトが生成されて初期化されたことを示す Init // Done は、オブジェクトが生成されて全ての値がFillされたことを示す Done )
type Filler ¶
type Filler struct { FieldFilter func(structType reflect.Type, field reflect.StructField, value reflect.Value) bool // contains filtered or unexported fields }
Filler はオブジェクトの内容を生成する
func RandomFiller ¶
func RandomFiller(seed *RandomSeed) *Filler
RandomFiller は、プリミティブ型の値をランダムに設定する Filler を取得します
func (*Filler) RegisterFunc ¶
func (g *Filler) RegisterFunc(con TypedFactory)
RegisterFunc はオブジェクトの生成関数を登録します
func (*Filler) RegisterKind ¶
RegisterKind は kind: 型種別に紐づく con: 生成関数を登録します
type RandomSeed ¶
type RandomSeed struct { Random *rand.Rand NilRate float64 SliceCapacity int SliceMinimum int StringCapacity int StringMinimum int MapLength int }
RandomSeed は、RandomGeneratorで使用する乱数のパラメータです
type TypedFactory ¶
type TypedFactory func(typ reflect.Type) (interface{}, FactoryState)
TypedFactory は型の指定に基づきオブジェクトを生成する関数の定義
Click to show internal directories.
Click to hide internal directories.