1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-10 05:25:58 +00:00

partial cleanup of the macro pkg and move it from /core/router to the root because it may be used by the end-developers now to ammend the available macros per application

Former-commit-id: 951a5e7a401af25ecaa904ff6463b0def2c87afb
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-09-29 02:41:51 +03:00
parent bf880033cd
commit 6d9a35ddba
25 changed files with 119 additions and 129 deletions

View File

@@ -15,6 +15,11 @@ import (
)
type (
// ValueSetter is the interface which can be accepted as a generic solution of RequestParams or memstore when Set is the only requirement,
// i.e internally on macro/template/TemplateParam#Eval:paramChanger.
ValueSetter interface {
Set(key string, newValue interface{}) (Entry, bool)
}
// Entry is the entry of the context storage Store - .Values()
Entry struct {
Key string
@@ -26,6 +31,8 @@ type (
Store []Entry
)
var _ ValueSetter = (*Store)(nil)
// GetByKindOrNil will try to get this entry's value of "k" kind,
// if value is not that kind it will NOT try to convert it the "k", instead
// it will return nil, except if boolean; then it will return false