identity.go 401 B

123456789101112131415161718192021
  1. package identity
  2. import (
  3. "github.com/kataras/iris/v12"
  4. "time"
  5. "xps/bootstrap"
  6. )
  7. func New(b *bootstrap.Bootstrapper) iris.Handler {
  8. return func(ctx iris.Context) {
  9. ctx.Header("App-Name", b.AppName)
  10. ctx.Header("App-Owner", b.AppOwner)
  11. ctx.Header("App-since", time.Since(b.AppSpawnDate).String())
  12. ctx.Next()
  13. }
  14. }
  15. func Configure(b *bootstrap.Bootstrapper) {
  16. h := New(b)
  17. b.UseGlobal(h)
  18. }