mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-09-13 14:59:09 +00:00
add utils
This commit is contained in:
parent
219c451098
commit
f952b51065
2 changed files with 53 additions and 0 deletions
13
util/context.go
Normal file
13
util/context.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func GetContext() context.Context {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), viper.GetViper().GetDuration("timeout"))
|
||||
_ = cancel
|
||||
return ctx
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue