Skip to content

Instantly share code, notes, and snippets.

@chris001177
Created June 21, 2019 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris001177/651c5d783cff873f975f3c43835d892a to your computer and use it in GitHub Desktop.
Save chris001177/651c5d783cff873f975f3c43835d892a to your computer and use it in GitHub Desktop.
package config
import (
"github.com/myproject/definition"
"time"
)
// Since the definition package must not contain any logic,
// managing configuration is implemented in a config package.
func InitPermissions() {
definition.RolePermissions = definition.ConfigDBInstance.AllPermissions()
go func() {
for {
time.Sleep(time.Hour)
definition.RolePermissions = definition.ConfigDBInstance.AllPermissions()
}
}()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment