Documentation
¶
Index ¶
- type Configurator
- type Field
- func (f *Field) AddOption(option *proto.FieldOption) *Field
- func (f *Field) AsAutofilled()
- func (f *Field) AsRepeated() *Field
- func (f *Field) AsRequired() *Field
- func (f *Field) Autofilled() bool
- func (f *Field) Column() *schema.Column
- func (f *Field) CopyType(b *Field) *Field
- func (f *Field) IsRequired() bool
- func (f *Field) Message() *Message
- func (f *Field) Name() string
- func (f *Field) NotRequired() *Field
- func (f *Field) SetColumn(column *schema.Column) *Field
- func (f *Field) SetTopComment(comment string) *Field
- func (f *Field) SetType(typ string) *Field
- type File
- func (f *File) AddEnum(name gds.String, values []string)
- func (f *File) AddImport(dependency string)
- func (f *File) AddMessage(msg *proto.Message)
- func (f *File) AddService(table *schema.Table, createTableMessage func(*TableMessage)) *Service
- func (f *File) Name() string
- func (f *File) Package() *Package
- func (f *File) Render(indent *iox.Indent) string
- func (f *File) SetOptions(options map[string]proto.Option) *File
- type Message
- type MessageType
- type Package
- type Procedure
- type ProcedureType
- type Service
- func (s *Service) AddProcedure(name string, typ ProcedureType, reqBuild func(message *Message)) *Service
- func (s *Service) AddProcedureFn(name string, typ ProcedureType, reqBuild func(message *Message), ...) *Service
- func (s *Service) AddProcedureWithResponseName(name string, typ ProcedureType, reqBuild func(message *Message), ...) *Service
- func (s *Service) File() *File
- func (s *Service) HasProcedures() bool
- func (s *Service) SetCommentTop(comment string) *Service
- func (s *Service) TableMessage() *TableMessage
- type TableMessage
- func (t *TableMessage) CreateField(name string, columnName string, creator func(*Field)) *TableMessage
- func (t *TableMessage) CreatePrimaryKeyField(name string, columnName string, creator func(field *Field)) *TableMessage
- func (t *TableMessage) GetField(name string) (*Field, bool)
- func (t *TableMessage) Name() string
- func (t *TableMessage) SingularNameForField() string
- func (t *TableMessage) Table() *schema.Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configurator ¶
type Configurator func(cfg *config)
func WithModifyField ¶
func WithModifyField(modifier func(field *Field)) Configurator
func WithModifyProcedure ¶
func WithModifyProcedure(modifier func(procedure *Procedure)) Configurator
func WithModifyService ¶
func WithModifyService(modifier func(*Service)) Configurator
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) AsAutofilled ¶ added in v0.5.7
func (f *Field) AsAutofilled()
func (*Field) AsRepeated ¶
func (*Field) AsRequired ¶
func (*Field) Autofilled ¶ added in v0.5.7
func (*Field) IsRequired ¶
func (*Field) NotRequired ¶ added in v0.5.6
func (*Field) SetTopComment ¶ added in v0.5.6
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) AddMessage ¶
func (*File) AddService ¶
func (f *File) AddService( table *schema.Table, createTableMessage func(*TableMessage), ) *Service
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func (*Message) CreateField ¶
func (*Message) Type ¶ added in v0.5.6
func (msg *Message) Type() MessageType
type MessageType ¶ added in v0.5.6
type MessageType uint8
const ( MessageTypeRequest MessageType = iota MessageTypeResponse MessageTypeTable )
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
func NewPackage ¶
func NewPackage(name string, configurators ...Configurator) *Package
func (*Package) CreateFile ¶
type Procedure ¶
type Procedure struct {
// contains filtered or unexported fields
}
func (*Procedure) AddOption ¶
func (p *Procedure) AddOption(option *proto.ServiceProcedureOption)
func (*Procedure) SetCommentTop ¶
func (*Procedure) ToProto ¶
func (p *Procedure) ToProto() *proto.ServiceProcedure
func (*Procedure) Type ¶
func (p *Procedure) Type() ProcedureType
type ProcedureType ¶
type ProcedureType string
const ( ProcedureTypeList ProcedureType = "List" ProcedureTypeGet ProcedureType = "Get" ProcedureTypeCreate ProcedureType = "Create" ProcedureTypeUpdate ProcedureType = "Update" ProcedureTypeDelete ProcedureType = "Delete" ProcedureTypeUndelete ProcedureType = "Undelete" )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AddProcedure ¶ added in v0.5.7
func (s *Service) AddProcedure(name string, typ ProcedureType, reqBuild func(message *Message)) *Service
func (*Service) AddProcedureFn ¶
func (*Service) AddProcedureWithResponseName ¶ added in v0.5.7
func (*Service) HasProcedures ¶
func (*Service) SetCommentTop ¶
func (*Service) TableMessage ¶
func (s *Service) TableMessage() *TableMessage
type TableMessage ¶
type TableMessage struct {
PrimaryKey []*Field
// contains filtered or unexported fields
}
func (*TableMessage) CreateField ¶
func (t *TableMessage) CreateField(name string, columnName string, creator func(*Field)) *TableMessage
func (*TableMessage) CreatePrimaryKeyField ¶
func (t *TableMessage) CreatePrimaryKeyField(name string, columnName string, creator func(field *Field)) *TableMessage
func (*TableMessage) Name ¶
func (t *TableMessage) Name() string
func (*TableMessage) SingularNameForField ¶ added in v0.5.7
func (t *TableMessage) SingularNameForField() string
func (*TableMessage) Table ¶
func (t *TableMessage) Table() *schema.Table
Click to show internal directories.
Click to hide internal directories.