Documentation ¶
Index ¶
- Variables
- func ParseComment(s string) []string
- func ParseTypeID(t TypeID) (typeName string, packagePath []string, err error)
- func ValidateCamelCase(n string) error
- func ValidateEventName(n EventName) error
- func ValidatePascalCase(n string) error
- func ValidateProjectionName(n ProjectionName) error
- func ValidateProjectionState(n ProjectionState) error
- func ValidatePropertyName(n PropertyName) error
- func ValidateServiceMethodName(n ServiceMethodName) error
- func ValidateServiceName(n ServiceName) error
- type Event
- type EventName
- type Generator
- type GeneratorOptions
- type ModelEvent
- type ModelProjection
- type ModelProperties
- type ModelProperty
- type ModelSchema
- type ModelService
- type ModelServiceMethod
- type ModelServiceMethods
- type ModelTransition
- type Projection
- type ProjectionName
- type ProjectionState
- type Property
- type PropertyName
- type Schema
- type SemanticErr
- type Service
- type ServiceMethod
- type ServiceMethodName
- type ServiceMethodType
- type ServiceName
- type SourcePackage
- type SourcePackageID
- type SourcePackageName
- type SyntaxErr
- type Transition
- type Type
- type TypeID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMustBeginWithLowerLatin = errors.New( "must begin with a lower case latin character", ) ErrMustBeginWithUpperLatin = errors.New( "must begin with an upper case latin character", ) ErrContainsIllegalChars = errors.New( "contains illegal characters", ) ErrEmpty = errors.New("empty") )
Functions ¶
func ParseComment ¶
func ValidateCamelCase ¶
func ValidateEventName ¶
func ValidatePascalCase ¶
func ValidateProjectionName ¶
func ValidateProjectionName(n ProjectionName) error
func ValidateProjectionState ¶
func ValidateProjectionState(n ProjectionState) error
func ValidatePropertyName ¶
func ValidatePropertyName(n PropertyName) error
func ValidateServiceMethodName ¶
func ValidateServiceMethodName(n ServiceMethodName) error
func ValidateServiceName ¶
func ValidateServiceName(n ServiceName) error
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator() *Generator
type GeneratorOptions ¶
func (*GeneratorOptions) Prepare ¶
func (o *GeneratorOptions) Prepare() error
Prepare validates the options and sets defaults for undefined values
type ModelEvent ¶
type ModelEvent = ModelProperties
type ModelProjection ¶
type ModelProjection struct { States []ProjectionState `yaml:"states"` Properties ModelProperties `yaml:"properties"` CreateOn EventName `yaml:"createOn"` Transitions map[EventName][]ModelTransition `yaml:"transitions"` }
type ModelProperties ¶
type ModelProperties struct {
// contains filtered or unexported fields
}
func (*ModelProperties) UnmarshalYAML ¶
func (m *ModelProperties) UnmarshalYAML(v *yaml.Node) error
type ModelProperty ¶
type ModelSchema ¶
type ModelSchema struct { Events map[EventName]ModelEvent `yaml:"events"` Projections map[ProjectionName]ModelProjection `yaml:"projections"` Services map[ServiceName]ModelService `yaml:"services"` }
type ModelService ¶
type ModelService struct { Projections []ProjectionName `yaml:"projections"` Methods ModelServiceMethods `yaml:"methods"` }
type ModelServiceMethod ¶
type ModelServiceMethods ¶
type ModelServiceMethods struct {
// contains filtered or unexported fields
}
func (*ModelServiceMethods) UnmarshalYAML ¶
func (m *ModelServiceMethods) UnmarshalYAML(v *yaml.Node) error
type ModelTransition ¶
type ModelTransition = string
type Projection ¶
type Projection struct { Schema *Schema Name ProjectionName States map[ProjectionState]struct{} InitialState ProjectionState Properties []*Property CreateOn *Event Transitions map[*Event][]*Transition }
type ProjectionName ¶
type ProjectionName = string
type ProjectionState ¶
type ProjectionState = string
type Property ¶
type Property struct { Position int Name PropertyName Type *Type CommentLines []string }
type PropertyName ¶
type PropertyName = string
type Schema ¶
type Schema struct { Raw string Events map[EventName]*Event Projections map[ProjectionName]*Projection Services map[ServiceName]*Service SourcePackages map[SourcePackageID]*SourcePackage SourcePackage *SourcePackage SourceModule string }
type SemanticErr ¶
type SemanticErr string
func (SemanticErr) Error ¶
func (s SemanticErr) Error() string
type Service ¶
type Service struct { Schema *Schema Name ServiceName Projections []*Projection Methods map[ServiceMethodName]*ServiceMethod Subscriptions map[EventName]*Event }
type ServiceMethod ¶
type ServiceMethod struct { Service *Service Name ServiceMethodName Type ServiceMethodType Input *Type Output *Type Emits []*Event CommentLines []string }
type ServiceMethodName ¶
type ServiceMethodName = string
type ServiceMethodType ¶
type ServiceMethodType = string
type ServiceName ¶
type ServiceName = string
type SourcePackage ¶
type SourcePackage struct { Path string // Absolute directory path ImportPath string // Import path relative to the module Name SourcePackageName ID SourcePackageID // dot-separated unique identifier Types map[TypeID]*Type }
type SourcePackageID ¶
type SourcePackageID = string
type SourcePackageName ¶
type SourcePackageName = string
type Transition ¶
type Transition struct { Projection *Projection On *Event From ProjectionState To ProjectionState }
Click to show internal directories.
Click to hide internal directories.