1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-06 03:27:27 +00:00

acesslog new example: custom fields and custom template

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-10 21:40:30 +03:00
parent 2bb04823b0
commit 16a794a245
4 changed files with 55 additions and 2 deletions

View File

@@ -816,6 +816,15 @@ func (r *Store) GetDefault(key string, def interface{}) interface{} {
return vv
}
// Exists is a small helper which reports whether a key exists.
// It's not recommended to be used outside of templates.
// Use Get or GetEntry instead which will give you back the entry value too,
// so you don't have to loop again the key-value storage to get its value.
func (r *Store) Exists(key string) bool {
_, ok := r.GetEntry(key)
return ok
}
// Get returns the entry's value based on its key.
// If not found returns nil.
func (r *Store) Get(key string) interface{} {