config: add helpers to load/save options (#60)

This commit is contained in:
2021-11-18 15:46:30 +03:00
committed by GitHub
parent 1829febb6e
commit fbad257acc
2 changed files with 23 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ type LoadOptions struct {
Struct interface{}
Override bool
Append bool
Context context.Context
}
func NewLoadOptions(opts ...LoadOption) LoadOptions {
@@ -102,7 +103,8 @@ type SaveOption func(o *SaveOptions)
// SaveOptions struct
type SaveOptions struct {
Struct interface{}
Struct interface{}
Context context.Context
}
// SaveStruct override struct for save to config