Dev
This commit is contained in:
6
opts/decort_opts.go
Normal file
6
opts/decort_opts.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package opts
|
||||
|
||||
type DecortOpts struct {
|
||||
Type string
|
||||
Value string
|
||||
}
|
||||
26
opts/opts.go
Normal file
26
opts/opts.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package opts
|
||||
|
||||
import "github.com/rudecs/decort-sdk/typed"
|
||||
|
||||
type Opts struct {
|
||||
IsAdmin bool
|
||||
AdminValue string
|
||||
}
|
||||
|
||||
func New(options []DecortOpts) *Opts {
|
||||
if len(options) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
option := &Opts{}
|
||||
|
||||
for _, v := range options {
|
||||
if v.Type == typed.TypeAdmin {
|
||||
option.IsAdmin = true
|
||||
option.AdminValue = v.Value
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return option
|
||||
}
|
||||
Reference in New Issue
Block a user