generator

package
v0.0.0-...-82560b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Distinguishable               string = "OffersDistinguishable"
	DistinguishableAsserter              = "RequiresDistinguishableAsserter"
	DistinguishableMethod                = "Identifier"
	DistinguishableAsserterMethod        = "IsDistinguishable"

	Authorizable  = "OffersAuthorizable"
	Policer       = "RequiresPolicer"
	PolicerMethod = "Can"

	StorageReader          = "RequiresStorageReader"
	StorageWriterReader    = "RequiresStorageWriterReader"
	StorageLoadMethod      = "Load"
	StorageSaveMethod      = "Save"
	StorageSaveFactsMethod = "SaveFacts"

	CommandHandler       = "RequiresCommandHandler"
	CommandHandlerMethod = "Handle"
	ErrorKeeper          = "RequiresErrorKeeper"
	ErrorKeeperMethod    = "Errors"
	FactKeeper           = "OffersFactKeeper"
	FactKeeperMethod     = "Facts"
)

Constants represent invariant contract requirements that would have been too cumbersome to expose as configuration They _could_ be configuration, there is just not much gain in it.

Variables

This section is empty.

Functions

func GenAppIfacesDoc

func GenAppIfacesDoc(pkgName string) *File

func GenCmdHandlerIface

func GenCmdHandlerIface(entity QualId, useFactStorage bool, pkgName string) (f *File, cmd, ek, fk string)

func GenCommandDoc

func GenCommandDoc(docFile string) *File

func GenCommandHandlerWrapper

func GenCommandHandlerWrapper(cmd,
	topic string,
	useFactStorage,
	withPolicyEnforcement bool,
	adapters Adapters,
	objects Objects,
	errors Errors) *File

func GenIfaceAuthorizable

func GenIfaceAuthorizable(pkgName string) (f *File, typIdent string)

func GenIfaceDistinguishable

func GenIfaceDistinguishable(pkgName string) (f *File, typIdent string)

func GenIfaceDistinguishableAsserter

func GenIfaceDistinguishableAsserter(pkgName string) (f *File, typIdent string)

func GenIfacePolicer

func GenIfacePolicer(entity QualId, pkgName string) (f *File, typIdent string)

func GenStorageIface

func GenStorageIface(entity QualId, useFactStorage bool, pkgName string) (f *File, storageReaderTypeIdent, storageReaderWriterTypeIdent string)

Types

type Adapters

type Adapters struct {
	StorageR           NamedQualId
	StorageRW          NamedQualId
	Policer            NamedQualId
	DomServiceAdapters []NamedQualId
}

Adapters provide interfaces to the outer world

type Errors

type Errors struct {
	AuthorizationErrorNew        QualId
	TargetIdentificationErrorNew QualId
	StorageLoadingErrorNew       QualId
	StorageSavingErrorNew        QualId
	DomainErrorNew               QualId
}

Error constructors create error values

type NamedQualId

type NamedQualId struct {
	Name string
	QualId
}

type Objects

type Objects struct {
	Target         QualId // target represents a distinguishable entity
	Entity         QualId // entity represents a non-distinguishable concrete entity
	Actor          QualId // actor represents the caller of a command
	CommandHandler QualId // command handler handles domain commands
	ErrorKeeper    QualId // error keeper keeps domain errors
	FactKeeper     QualId // fact keeper keeps domain facts
	Domain         QualId // a qual only referncinf the domain import path

}

Objects are represented by application level or domain interfaces

type QualId

type QualId struct{ Id, Qual string }

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL