Documentation
¶
Overview ¶
------------------------------------------------------------------------------------------------ Here is the common code for writing business objects ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here are the enums used for building business object classes ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ The code here is about how we productively load whole data tree of business objects ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ The code here is about having tools to describe the properties (fields & relationships) of a business object class, and specifying things for these properties ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Some utilities to help build classes ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ The code here is about how we describe endpoints ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Out-of-the-box endpoints to quickly have SCRUD working with Business Objects ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ The code here is about registering globally accessible objects. ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the starting point of any Goald app: the initialisation of a server ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here we configure the the server ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here are defined the contexts passed in the different layers of our multi-tier architecture: - (no context) for the business object layer (*--.go files) - BloContext for the Business LOgic code (used in *--blo.go files) - DaoContext for the Data Access Objects (used in *--dao.go files) - WebContext for the web endpoints code (used in *--web.go files) ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ The code here is about the loading of data for the server to work properly. Data loaders - which are functions with the same signature - must be registered through a function defined here. Beware: data loaders can be invoked in parallel, so there should not be any dependency between them. If you have some logic about several data loading bits, you must implement it within one data loader. ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ This is about handling HTTP requests ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Defining here all the information ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the global code generation routine ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the code used to generate the classes, which is the static information we can extract from using AST/basic code parsing. ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the code used for generating the DB list ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the code used for generating the class files ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the code used for generating the class files ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the code used for generating the BO models in the web app ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the code used for generating the VMAP (value mapper) files ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is the code used for generating the VMAP (value mapper) files ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ The code here is about checking that the devs haven't forgotten some stuff, like telling each relationship's type, some properties' size, if a class is persisted or not, etc. ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here we implement the generic data access instructions involved in CRUD N.B. quick & dirty implems for now ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here we implement the generic business logic involved in CRUD N.B. quick & dirty implems for now ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here is provided a general way of doing HTTP request to external data providers ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here we implement some generic request handlers involved in CRUD N.B. quick & dirty implems for now ------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------ Here we implement the generic endpoint service the API's documentation ------------------------------------------------------------------------------------------------
Index ¶
- func CreateBO(bloCtx BloContext, bObj IBusinessObject) error
- func DeleteOne[ResourceType IBusinessObject](handlerFunc func(webCtx WebContext) (ResourceType, hstatus.Code, string)) *oneForNoneEndpoint[ResourceType]
- func Error(msg string, params ...any) error
- func ErrorC(cause error, msg string, params ...any) error
- func GenericHandleCreate[BOTYPE IBusinessObject]() *oneForOneEndpoint[BOTYPE, BOTYPE]
- func GenericHandleDelete[BOTYPE IBusinessObject](idProp IField) *oneForNoneEndpoint[BOTYPE]
- func GenericHandleRead[BOTYPE IBusinessObject](idProp IField, loadingType LoadingType) *oneForNoneEndpoint[BOTYPE]
- func GenericHandleUpdate[BOTYPE IBusinessObject](loadingType LoadingType) *oneForOneEndpoint[BOTYPE, BOTYPE]
- func GetMany[ResourceType IBusinessObject](handlerFunc func(webCtx WebContext) ([]ResourceType, hstatus.Code, string), ...) *manyForNoneEndpoint[ResourceType]
- func GetManyWithParams[ResourceType IBusinessObject, QueryParamsType IURLQueryParams](...) *manyForOneEndpoint[QueryParamsType, ResourceType]
- func GetOne[ResourceType IBusinessObject](handlerFunc func(webCtx WebContext) (ResourceType, hstatus.Code, string), ...) *oneForNoneEndpoint[ResourceType]
- func HandleGetAll[ResourceType IBusinessObject](webCtx WebContext) ([]ResourceType, hstatus.Code, string)
- func HttpGet(url string, failOnBadStatusCode bool) *outgoingHttpRequest
- func HttpGetBObjList[ResponseType IBusinessObject](outReq *outgoingHttpRequest, responseList []ResponseType) ([]ResponseType, hstatus.Code, error)
- func HttpGetBObject[ResponseType IBusinessObject](outReq *outgoingHttpRequest, responseObj ResponseType) (ResponseType, hstatus.Code, error)
- func HttpGetResponseAs[ResponseType any](outReq *outgoingHttpRequest, responseObj *ResponseType) (*ResponseType, hstatus.Code, error)
- func HttpPost(url string, failOnBadStatusCode bool) *outgoingHttpRequest
- func HttpPut(url string, failOnBadStatusCode bool) *outgoingHttpRequest
- func In(module moduleName) *moduleClassRegitry
- func LoadBOs[ResourceType IBusinessObject](bloCtx BloContext, model IBusinessObjectModel, loadingType LoadingType) ([]ResourceType, error)
- func NewBaseConfig() *serverConfig
- func PostManyGetMany[InputType, ResourceType IBusinessObject](...) *manyForManyEndpoint[InputType, ResourceType]
- func PostOneGetOne[InputType, ResourceType IBusinessObject](...) *oneForOneEndpoint[InputType, ResourceType]
- func PutOne[InputType, ResourceType IBusinessObject](...) *oneForOneEndpoint[ResourceType, ResourceType]
- func RecoverError(msg string, params ...any)
- func RegisterConfig(cfgObj IServerConfig)
- func RegisterDataLoader(fn dataLoader, migrationPhase bool)
- func RegisterModel(name className, model IBusinessObjectModel)
- func UpdateBO(bloCtx BloContext, input IBusinessObject, loadingType LoadingType) error
- type AppContext
- type BObjID
- type BigIntField
- type BloContext
- type BoolField
- type BusinessObject
- func (thisBO *BusinessObject) ChangeAfterInsert(BloContext) error
- func (thisBO *BusinessObject) ChangeBeforeInsert(BloContext) error
- func (thisBO *BusinessObject) GetID() BObjID
- func (thisBO *BusinessObject) GetModel() IBusinessObjectModel
- func (thisBO *BusinessObject) IsValid(BloContext) error
- func (thisBO *BusinessObject) Load(loadingType LoadingType, with ...*LoadingScenario) *LoadingScenario
- type DB
- type DaoContext
- type DatabaseID
- type DateField
- type DoubleField
- type EndpointGroup
- type EnumField
- type IBaseConfig
- type IBusinessObject
- type IBusinessObjectModel
- type IClass
- type IClassCore
- type ICustomConfig
- type IEnum
- type IField
- type IOutgoingHttpRequest
- type IServerConfig
- type IURLQueryParams
- type IURLQueryParamsModel
- type IUser
- type IntField
- type LoadingScenario
- type LoadingType
- type PropertyType
- type RealField
- type Relationship
- func (r *Relationship) SetChildToParent(backRefRelation *Relationship) *Relationship
- func (r *Relationship) SetOneWay() *Relationship
- func (r *Relationship) SetSourceToTarget(backRefRelation *Relationship) *Relationship
- func (r *Relationship) SetTargets(targets ...IBusinessObjectModel) *Relationship
- type ServerContext
- type StringField
- type URLQueryParams
- type WebContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBO ¶
func CreateBO(bloCtx BloContext, bObj IBusinessObject) error
Controls, DB-inserts, post-treats the given BO TODO - quick & dirty implem for now func CreateBO[BOTYPE IBusinessObject](bloCtx BloContext, bObj *BOTYPE) error {
func DeleteOne ¶
func DeleteOne[ResourceType IBusinessObject]( handlerFunc func(webCtx WebContext) (ResourceType, hstatus.Code, string), ) *oneForNoneEndpoint[ResourceType]
Declaring an endpoint to delete 1 BO instance with a DELETE request
func GenericHandleCreate ¶
func GenericHandleCreate[BOTYPE IBusinessObject]() *oneForOneEndpoint[BOTYPE, BOTYPE]
func GenericHandleDelete ¶
func GenericHandleDelete[BOTYPE IBusinessObject](idProp IField) *oneForNoneEndpoint[BOTYPE]
func GenericHandleRead ¶
func GenericHandleRead[BOTYPE IBusinessObject](idProp IField, loadingType LoadingType) *oneForNoneEndpoint[BOTYPE]
func GenericHandleUpdate ¶
func GenericHandleUpdate[BOTYPE IBusinessObject](loadingType LoadingType) *oneForOneEndpoint[BOTYPE, BOTYPE]
func GetMany ¶
func GetMany[ResourceType IBusinessObject]( handlerFunc func(webCtx WebContext) ([]ResourceType, hstatus.Code, string), loadingType LoadingType, ) *manyForNoneEndpoint[ResourceType]
Declaring an endpoint to return N BO instances from a GET request
func GetManyWithParams ¶
func GetManyWithParams[ResourceType IBusinessObject, QueryParamsType IURLQueryParams]( handlerFunc func(webCtx WebContext, queryParams QueryParamsType) ([]ResourceType, hstatus.Code, string), loadingType LoadingType, ) *manyForOneEndpoint[QueryParamsType, ResourceType]
Declaring an endpoint to return N BO instance from query parameters that are described with 1 URLQueryParams
func GetOne ¶
func GetOne[ResourceType IBusinessObject]( handlerFunc func(webCtx WebContext) (ResourceType, hstatus.Code, string), loadingType LoadingType, ) *oneForNoneEndpoint[ResourceType]
Declaring an endpoint to return 1 BO instance from a GET request
func HandleGetAll ¶
func HandleGetAll[ResourceType IBusinessObject](webCtx WebContext) ([]ResourceType, hstatus.Code, string)
Simply listing the resources of a targeted type
func HttpGetBObjList ¶
func HttpGetBObjList[ResponseType IBusinessObject](outReq *outgoingHttpRequest, responseList []ResponseType) ([]ResponseType, hstatus.Code, error)
Runs a prepared Rest HTTP request to an external service, and retrieves the list of Goald business objects from the response
func HttpGetBObject ¶
func HttpGetBObject[ResponseType IBusinessObject](outReq *outgoingHttpRequest, responseObj ResponseType) (ResponseType, hstatus.Code, error)
Runs a prepared Rest HTTP request to an external service, and retrieves the Goald business object from the response
func HttpGetResponseAs ¶
func HttpGetResponseAs[ResponseType any](outReq *outgoingHttpRequest, responseObj *ResponseType) (*ResponseType, hstatus.Code, error)
Runs a prepared Rest HTTP request to an external service, and fills the given object with the response body
func In ¶
func In(module moduleName) *moduleClassRegitry
allows to declare a new module where to register Classes
func LoadBOs ¶
func LoadBOs[ResourceType IBusinessObject](bloCtx BloContext, model IBusinessObjectModel, loadingType LoadingType) ([]ResourceType, error)
func NewBaseConfig ¶
func NewBaseConfig() *serverConfig
func PostManyGetMany ¶
func PostManyGetMany[InputType, ResourceType IBusinessObject]( handlerFunc func(webCtx WebContext, input []InputType) ([]ResourceType, hstatus.Code, string), loadingType LoadingType, ) *manyForManyEndpoint[InputType, ResourceType]
Declaring an endpoint to return N BO instance from N POSTed BO instances
func PostOneGetOne ¶
func PostOneGetOne[InputType, ResourceType IBusinessObject]( handlerFunc func(webCtx WebContext, input InputType) (ResourceType, hstatus.Code, string), loadingType LoadingType, ) *oneForOneEndpoint[InputType, ResourceType]
Declaring an endpoint to return 1 BO instance from 1 POSTed BO instance
func PutOne ¶
func PutOne[InputType, ResourceType IBusinessObject]( handlerFunc func(webCtx WebContext, input ResourceType) (ResourceType, hstatus.Code, string), loadingType LoadingType, ) *oneForOneEndpoint[ResourceType, ResourceType]
Declaring an endpoint to return 1 BO instance from 1 PUT BO instance
func RecoverError ¶
func RegisterConfig ¶
func RegisterConfig(cfgObj IServerConfig)
func RegisterDataLoader ¶
func RegisterDataLoader(fn dataLoader, migrationPhase bool)
func RegisterModel ¶
func RegisterModel(name className, model IBusinessObjectModel)
registering happens in the "model" package, gence the public function
func UpdateBO ¶
func UpdateBO(bloCtx BloContext, input IBusinessObject, loadingType LoadingType) error
Types ¶
type AppContext ¶
type AppContext interface {
CustomConfig() ICustomConfig // returns the app's custom part of the config
}
------------------------------------------------------------------------------------------------ AppContext contains the minimal info set that should be accessible in all the layers of the app ------------------------------------------------------------------------------------------------
type BigIntField ¶
type BigIntField struct {
// contains filtered or unexported fields
}
func NewBigIntField ¶
func NewBigIntField(owner IBusinessObjectModel, name string, multiple bool) *BigIntField
func (*BigIntField) Max ¶
func (f *BigIntField) Max(max int64) *BigIntField
func (*BigIntField) Min ¶
func (f *BigIntField) Min(min int64) *BigIntField
type BloContext ¶
type BloContext interface {
GetDaoContext() DaoContext
// contains filtered or unexported methods
}
------------------------------------------------------------------------------------------------ BloContext is a context that should provide the necessary info for Business LOgic code
type BoolField ¶
type BoolField struct {
// contains filtered or unexported fields
}
func NewBoolField ¶
func NewBoolField(owner IBusinessObjectModel, name string, multiple bool) *BoolField
func (*BoolField) SetDefaultValue ¶
func (f *BoolField) SetDefaultValue(val string) *field
func (*BoolField) SetNotPersisted ¶
func (f *BoolField) SetNotPersisted() *field
type BusinessObject ¶
type BusinessObject struct {
ID BObjID `json:"id,omitempty" io:"o*" desc:"The unique identifier of this business object"`
// contains filtered or unexported fields
}
func (*BusinessObject) ChangeAfterInsert ¶
func (thisBO *BusinessObject) ChangeAfterInsert(BloContext) error
func (*BusinessObject) ChangeBeforeInsert ¶
func (thisBO *BusinessObject) ChangeBeforeInsert(BloContext) error
func (*BusinessObject) GetID ¶
func (thisBO *BusinessObject) GetID() BObjID
func (*BusinessObject) GetModel ¶
func (thisBO *BusinessObject) GetModel() IBusinessObjectModel
func (*BusinessObject) IsValid ¶
func (thisBO *BusinessObject) IsValid(BloContext) error
func (*BusinessObject) Load ¶
func (thisBO *BusinessObject) Load(loadingType LoadingType, with ...*LoadingScenario) *LoadingScenario
type DB ¶
goald's own DB object
func GetDB ¶
func GetDB(dbID DatabaseID) *DB
type DaoContext ¶
type DaoContext interface {
// contains filtered or unexported methods
}
------------------------------------------------------------------------------------------------ DaoContext should contain the necessary info for handling database access
type DatabaseID ¶
type DatabaseID string
type DateField ¶
type DateField struct {
// contains filtered or unexported fields
}
func NewDateField ¶
func NewDateField(owner IBusinessObjectModel, name string, multiple bool) *DateField
func (*DateField) SetDefaultValue ¶
func (f *DateField) SetDefaultValue(val string) *field
func (*DateField) SetNotPersisted ¶
func (f *DateField) SetNotPersisted() *field
type DoubleField ¶
type DoubleField struct {
// contains filtered or unexported fields
}
func NewDoubleField ¶
func NewDoubleField(owner IBusinessObjectModel, name string, multiple bool) *DoubleField
func (*DoubleField) Max ¶
func (f *DoubleField) Max(max float64) *DoubleField
func (*DoubleField) Min ¶
func (f *DoubleField) Min(min float64) *DoubleField
type EndpointGroup ¶
func NewEndpointGroup ¶
func NewEndpointGroup(name string, description string) *EndpointGroup
type EnumField ¶
type EnumField struct {
// contains filtered or unexported fields
}
func NewEnumField ¶
func NewEnumField(owner IBusinessObjectModel, name string, multiple bool, enumName string) *EnumField
func (*EnumField) SetDefaultValue ¶
func (f *EnumField) SetDefaultValue(val string) *field
func (*EnumField) SetNotPersisted ¶
func (f *EnumField) SetNotPersisted() *field
type IBaseConfig ¶
type IBaseConfig interface {
// contains filtered or unexported methods
}
type IBusinessObject ¶
type IBusinessObject interface {
// identification
GetModel() IBusinessObjectModel
GetID() BObjID
// business logic
ChangeBeforeInsert(BloContext) error
IsValid(BloContext) error
ChangeAfterInsert(BloContext) error
// contains filtered or unexported methods
}
func DeleteBO ¶
func DeleteBO(bloCtx BloContext, idProp IField, idPropVal string) (IBusinessObject, error)
func ReadBO ¶
func ReadBO(bloCtx BloContext, idProp IField, idPropVal string, loadingType LoadingType) (IBusinessObject, error)
type IBusinessObjectModel ¶
type IBusinessObjectModel interface {
SetDescription(description string) // to set the description of the model
SetNotPersisted() // to indicate this class has no instance persisted in a database
SetInDB(db *DB) // to associate the class with the DB where its instances are stored
SetAbstract() // to indicate this class does not model concrete business objects, but most probably a super class
// access to generic properties (fields & relationships)
ID() IField
// contains filtered or unexported methods
}
------------------------------------------------------------------------------------------------ Model for a business object model ------------------------------------------------------------------------------------------------
func NewBusinessObjectModel ¶
func NewBusinessObjectModel() IBusinessObjectModel
type IClass ¶
type IClass interface {
IClassCore
NewObject() any // a function to instantiate 1 BO corresponding to this entry
NewSlice() any // a function to instantiate an empty slice of BOs corresponding to this entry
}
A Class is an object associated with a specific Business Object type that provides automatically STATIC, generated utility methods to: - instantiate 1 or a slice of this BO type - help serializing / deserializing instances of this BO type - quickly perform ORM operations such as Insert(), Select(), Update(), Delete(), etc... - ...by containing methods such as GetSelectAllQuery(), GetInsertQuery(), etc
Each Class is loosely coupled to the corresponding BO type through a registry, using the BO class as key.
type IClassCore ¶
type IClassCore interface {
AsInterface() IClassCore // sets the class as an interface
GetValueAsString(IBusinessObject, string) string // returning a BO's field's value, given the field's name
SetValueAsString(IBusinessObject, string, string) error // setting a BO's field's value, given the field's name
// contains filtered or unexported methods
}
A Class Core is a set of information fields that are common to all the Class objects.
func NewClassCore ¶
func NewClassCore(srcPath, class, lastModification string) IClassCore
type ICustomConfig ¶
type ICustomConfig interface {
}
type IEnum ¶
type IEnum interface {
fmt.Stringer // each enum value has a default label
Val() int // each enum value has an integer value
Values() map[int]string // each enum has a set of values associated with labels
}
IEnum must be implemented by every enum type
type IOutgoingHttpRequest ¶
type IOutgoingHttpRequest interface {
WithData(dataObj any) IOutgoingHttpRequest
WithTimeout(timeout time.Duration) IOutgoingHttpRequest
WithBasicAuth(user, pass string) IOutgoingHttpRequest
WithHeader(key, value string) IOutgoingHttpRequest
}
interface & general methods
type IServerConfig ¶
type IServerConfig interface {
IBaseConfig
CustomConfig() ICustomConfig // the applicative, custom part of the config
}
type IURLQueryParams ¶
type IURLQueryParams interface {
IBusinessObject
}
particular business object
type IURLQueryParamsModel ¶
type IURLQueryParamsModel interface {
IBusinessObjectModel
}
particular business object class
func NewURLQueryParamsModel ¶
func NewURLQueryParamsModel() IURLQueryParamsModel
type IUser ¶
type IUser interface {
IBusinessObject
GetUsername() string
}
type IntField ¶
type IntField struct {
// contains filtered or unexported fields
}
func NewIntField ¶
func NewIntField(owner IBusinessObjectModel, name string, multiple bool) *IntField
type LoadingScenario ¶
type LoadingScenario struct {
}
func With ¶
func With(relationship *Relationship, with ...*LoadingScenario) *LoadingScenario
type LoadingType ¶
type LoadingType string
A loading type is a key for an object that fully describe how to load business objects with their relationships; a class can define several loading types, used in various situations
type PropertyType ¶
type PropertyType int
PropertyType represents the type of a business object's property
const ( // PropertyTypeUNKNOWN : when the property type is not recognized PropertyTypeUNKNOWN PropertyType = iota - 1 // PropertyTypeBOOL : for boolean properties PropertyTypeBOOL // PropertyTypeSTRING : for string properties PropertyTypeSTRING // PropertyTypeINT : for integer properties PropertyTypeINT // PropertyTypeINT64 : for integer properties PropertyTypeINT64 // PropertyTypeREAL32 : for 32-bits real number properties PropertyTypeREAL32 // PropertyTypeREAL64 : for 64-bits real number properties PropertyTypeREAL64 // PropertyTypeDATE : for date properties PropertyTypeDATE // PropertyTypeENUM : for enum properties PropertyTypeENUM // PropertyTypeRELATIONSHIP : for relationships to other entities PropertyTypeRELATIONSHIP )
func (PropertyType) String ¶
func (thisProperty PropertyType) String() string
func (PropertyType) Val ¶
func (thisProperty PropertyType) Val() int
Val helps implement the IEnum interface
func (PropertyType) Values ¶
func (thisProperty PropertyType) Values() map[int]string
Values helps implement the IEnum interface
type RealField ¶
type RealField struct {
// contains filtered or unexported fields
}
func NewRealField ¶
func NewRealField(owner IBusinessObjectModel, name string, multiple bool) *RealField
type Relationship ¶
type Relationship struct {
// contains filtered or unexported fields
}
func NewPolyRelationship ¶
func NewPolyRelationship(owner IBusinessObjectModel, name string, multiple bool) *Relationship
Allows to declare a new polymorphic relationship on a given class
func NewRelationship ¶
func NewRelationship(owner IBusinessObjectModel, name string, multiple bool, target IBusinessObjectModel) *Relationship
Allows to declare a new monomorphic relationship on a given class
func (*Relationship) SetChildToParent ¶
func (r *Relationship) SetChildToParent(backRefRelation *Relationship) *Relationship
Sets a relationship as a "child to parent" one; the backref relationship is needed
func (*Relationship) SetOneWay ¶
func (r *Relationship) SetOneWay() *Relationship
Sets a relationship as a "one way" one; is with no back ref
func (*Relationship) SetSourceToTarget ¶
func (r *Relationship) SetSourceToTarget(backRefRelation *Relationship) *Relationship
Sets a relationship as a "parent to children" one; the backref relationship is needed
func (*Relationship) SetTargets ¶
func (r *Relationship) SetTargets(targets ...IBusinessObjectModel) *Relationship
type ServerContext ¶
type ServerContext interface {
BloContext
Start()
}
------------------------------------------------------------------------------------------------ ServerContext is a particular Business Logic Context used at app startup Implemented by the `server` struct
func NewServer ¶
func NewServer() ServerContext
This function should be called in each Goald-based app
type StringField ¶
type StringField struct {
// contains filtered or unexported fields
}
func NewStringField ¶
func NewStringField(owner IBusinessObjectModel, name string, multiple bool) *StringField
func (*StringField) SetDefaultValue ¶
func (f *StringField) SetDefaultValue(val string) *field
func (*StringField) SetNotPersisted ¶
func (f *StringField) SetNotPersisted() *field
func (*StringField) SetSize ¶
func (sf *StringField) SetSize(size int, atLeast ...int) *field
type URLQueryParams ¶
type URLQueryParams struct {
BusinessObject
}
particular business object implem
type WebContext ¶
type WebContext interface {
GetBloContext() BloContext
GetTargetRefOrID() string
GetResource() IBusinessObjectModel // the class of the resource being requested
GetResourceLoadingType() LoadingType // returns the loading type of the current main resources (BOs) being worked on
// contains filtered or unexported methods
}
------------------------------------------------------------------------------------------------ WebContext provides the necessary info to applicatively handle incoming HTTP requests
Source Files
¶
- 0-bo-def.go
- 0-bo-enums.go
- 0-bo-loading.go
- 0-bo-model.go
- 0-bo-utils.go
- 0-endpoints-.go
- 0-endpoints-ootb.go
- 0-endpoints-utils.go
- 0-registries.go
- 1-server-.go
- 1-server-config.go
- 1-server-contexts.go
- 1-server-data.go
- 1-server-handle.go
- 1-server-struct.go
- 2-codegen-.go
- 2-codegen-1-classes.go
- 2-codegen-1-databases.go
- 2-codegen-2-apimodels.go
- 2-codegen-2-resolved.go
- 2-codegen-3-appmodels.go
- 2-codegen-3-maps.go
- 2-codegen-3-openapi.go
- 3-codecheck-.go
- 4-errors.go
- 5-db-.go
- 5-db-adapt-.go
- 5-db-adapt-mssql.go
- 5-db-automig.go
- 5-generic-dao.go
- 6-generic-blo-.go
- 6-generic-blo-http.go
- 7-generic-web-crud.go
- 7-generic-web-doc.go
- 9-auth-user.go
Directories
¶
| Path | Synopsis |
|---|---|
|
_include
|
|
|
i18n
Generated file, do not edit!
|
Generated file, do not edit! |
|
i18n/model
Generated file, do not edit!
|
Generated file, do not edit! |
|
iot
Generated file, do not edit!
|
Generated file, do not edit! |
|
iot/model
Generated file, do not edit!
|
Generated file, do not edit! |
|
features
|
|
|
hstatus
------------------------------------------------------------------------------------------------ This package is used to type the HTTP status codes, and allowing using them, rather than writing bare values like 200, 401, etc.
|
------------------------------------------------------------------------------------------------ This package is used to type the HTTP status codes, and allowing using them, rather than writing bare values like 200, 401, etc. |
|
i18n
------------------------------------------------------------------------------------------------ Here, mainly about loading the translations at startup ------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------ Here, mainly about loading the translations at startup ------------------------------------------------------------------------------------------------ |
|
i18n/class
Generated file, do not edit!
|
Generated file, do not edit! |
|
iot/class
Generated file, do not edit!
|
Generated file, do not edit! |
|
utils
------------------------------------------------------------------------------------------------ Ensuring we have a very limited use of the 'reflect' package.
|
------------------------------------------------------------------------------------------------ Ensuring we have a very limited use of the 'reflect' package. |