Documentation
¶
Index ¶
- func Apply(ctx context.Context, store entity.Store) error
- func Indexed(b *attrBuilder)
- func Many(b *attrBuilder)
- func Register(domain string, version string, fn func(schema *SchemaBuilder))
- func RegisterEncodedSchema(domain, version string, data []byte)
- func Required(b *attrBuilder)
- func Session(b *attrBuilder)
- type AttrOption
- type SchemaBuilder
- func (b *SchemaBuilder) Apply(ctx context.Context, store entity.Store) error
- func (s *SchemaBuilder) Attr(name, id string, typ entity.Id, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Bool(name, id string, opts ...AttrOption) entity.Id
- func (b *SchemaBuilder) Builder(name string) *SchemaBuilder
- func (s *SchemaBuilder) Bytes(name, id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Component(name, id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Duration(name, id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Enum(name, id string, values any, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Float(name, id string, opts ...AttrOption) entity.Id
- func (b *SchemaBuilder) Id(name string) entity.Id
- func (s *SchemaBuilder) Int64(name, id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Keyword(name, id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Label(name, id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Ref(name, id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Singleton(id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) String(name, id string, opts ...AttrOption) entity.Id
- func (s *SchemaBuilder) Time(name, id string, opts ...AttrOption) entity.Id
- type SchemaRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(domain string, version string, fn func(schema *SchemaBuilder))
func RegisterEncodedSchema ¶
Types ¶
type AttrOption ¶
type AttrOption func(*attrBuilder)
func AdditionalAttrs ¶
func AdditionalAttrs(attrs ...entity.Attr) AttrOption
func Choices ¶
func Choices(choices ...entity.Id) AttrOption
func Doc ¶
func Doc(doc string) AttrOption
func Tags ¶
func Tags(tags ...string) AttrOption
type SchemaBuilder ¶
type SchemaBuilder struct {
// contains filtered or unexported fields
}
func Builder ¶
func Builder(domain, version string) *SchemaBuilder
func (*SchemaBuilder) Attr ¶
func (s *SchemaBuilder) Attr(name, id string, typ entity.Id, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Bool ¶
func (s *SchemaBuilder) Bool(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Builder ¶
func (b *SchemaBuilder) Builder(name string) *SchemaBuilder
func (*SchemaBuilder) Bytes ¶
func (s *SchemaBuilder) Bytes(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Component ¶
func (s *SchemaBuilder) Component(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Duration ¶
func (s *SchemaBuilder) Duration(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Enum ¶
func (s *SchemaBuilder) Enum(name, id string, values any, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Float ¶
func (s *SchemaBuilder) Float(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Int64 ¶
func (s *SchemaBuilder) Int64(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Keyword ¶
func (s *SchemaBuilder) Keyword(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Label ¶
func (s *SchemaBuilder) Label(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Ref ¶
func (s *SchemaBuilder) Ref(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Singleton ¶
func (s *SchemaBuilder) Singleton(id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) String ¶
func (s *SchemaBuilder) String(name, id string, opts ...AttrOption) entity.Id
func (*SchemaBuilder) Time ¶
func (s *SchemaBuilder) Time(name, id string, opts ...AttrOption) entity.Id
type SchemaRegistry ¶
type SchemaRegistry struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.