invocation: round of cleanups/fixes
This commit is contained in:
committed by
Steve Moyer
parent
3dc0011628
commit
7d4f973171
22
token/internal/parse/parse.go
Normal file
22
token/internal/parse/parse.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package parse
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/ucan-wg/go-ucan/did"
|
||||
)
|
||||
|
||||
func OptionalDID(s *string) (did.DID, error) {
|
||||
if s == nil {
|
||||
return did.Undef, nil
|
||||
}
|
||||
return did.Parse(*s)
|
||||
}
|
||||
|
||||
func OptionalTimestamp(sec *int64) *time.Time {
|
||||
if sec == nil {
|
||||
return nil
|
||||
}
|
||||
t := time.Unix(*sec, 0)
|
||||
return &t
|
||||
}
|
||||
Reference in New Issue
Block a user