1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

New APIContainer.EnableStrictMode(bool) method. Read HISTORY.md

This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-04-22 14:00:00 +03:00
parent 43079f75d2
commit 6219e57135
9 changed files with 124 additions and 47 deletions

View File

@@ -893,11 +893,21 @@ func (api *APIBuilder) PartyFunc(relativePath string, partyBuilderFunc func(p Pa
return p
}
// PartyConfigurator is an interface which all child parties that are registered
// through `PartyConfigure` should implement.
type PartyConfigurator interface {
Configure(parent Party)
}
type (
// PartyConfigurator is an interface which all child parties that are registered
// through `PartyConfigure` should implement.
PartyConfigurator interface {
Configure(parent Party)
}
// StrictlyPartyConfigurator is an optional interface which a `PartyConfigurator`
// can implement to make sure that all exported fields having a not-nin, non-zero
// value before server starts.
// StrictlyPartyConfigurator interface {
// Strict() bool
// }
// Good idea but a `mvc or bind:"required"` is a better one I think.
)
// PartyConfigure like `Party` and `PartyFunc` registers a new children Party
// but instead it accepts a struct value which should implement the PartyConfigurator interface.