seaweedfs/weed/mq/schema/schema_builder_test.go
2024-04-18 22:27:18 -07:00

27 lines
565 B
Go

package schema
import (
"fmt"
"testing"
)
func TestSchemaBuilder(t *testing.T) {
rtb := NewRecordTypeBuilder()
rtb.AddStringField("ID").
AddLongField("CreatedAt").
AddLongField("ModifiedAt").
AddStringField("User")
recordType := rtb.Build()
fmt.Printf("RecordType: %v\n", recordType)
recordType2 := NewRecordTypeBuilder().
AddLongField("ID").
AddLongField("CreatedAt").
AddRecordField("Person", NewRecordTypeBuilder().
AddStringField("Name").
AddListField("emails", TypeString)).Build()
fmt.Printf("RecordType2: %v\n", recordType2)
}