Documentation ¶
Index ¶
- Constants
- func FromJSON(str []byte) (*PrivateMember, *PublicMember, error)
- func JsonPublicMemberValueBy(p1, p2 *JsonPublicMember) bool
- func MakePublicMemberJWT(signer *key.PrivateKey, pm *PublicMember) (string, error)
- func Matcher(args ...string) func(p *PrivateMember) bool
- func ToPrivateKeys(pkms []*PrivateMember) []*key.PrivateKey
- func ToPublicKeys(pkms []*PublicMember) []*key.PublicKey
- type JsonPrivateMember
- type JsonPrivatePublicMember
- type JsonPublicMember
- type JsonPublicMemberSorter
- type Member
- type MemberArg
- type MemberBase
- type MemberType
- type PrivateMember
- func Filter(pkms []*PrivateMember, filters ...func(*PrivateMember) bool) []*PrivateMember
- func FilterByType(pkms []*PrivateMember, typs ...MemberType) []*PrivateMember
- func JsToPrivateMember(jspriv *JsonPrivateMember) (*PrivateMember, error)
- func MakePrivateMember(pm *PrivateMemberArg) (*PrivateMember, error)
- type PrivateMemberArg
- type PublicMember
- type PublicMemberClaim
Constants ¶
View Source
const ( Device = MemberType("Device") Person = MemberType("Person") )
Variables ¶
This section is empty.
Functions ¶
func FromJSON ¶
func FromJSON(str []byte) (*PrivateMember, *PublicMember, error)
func JsonPublicMemberValueBy ¶
func JsonPublicMemberValueBy(p1, p2 *JsonPublicMember) bool
func MakePublicMemberJWT ¶
func MakePublicMemberJWT(signer *key.PrivateKey, pm *PublicMember) (string, error)
func Matcher ¶
func Matcher(args ...string) func(p *PrivateMember) bool
func ToPrivateKeys ¶
func ToPrivateKeys(pkms []*PrivateMember) []*key.PrivateKey
func ToPublicKeys ¶
func ToPublicKeys(pkms []*PublicMember) []*key.PublicKey
Types ¶
type JsonPrivateMember ¶
type JsonPrivateMember struct { Clazz string `json:"clazz"` Member PrivateKey string `json:"privatekey"` }
func ToJsonPrivateMember ¶
func ToJsonPrivateMember(pkms ...*PrivateMember) []*JsonPrivateMember
func (*JsonPrivateMember) AsPrivateMember ¶
func (pm *JsonPrivateMember) AsPrivateMember() (*PrivateMember, error)
func (*JsonPrivateMember) String ¶
func (pm *JsonPrivateMember) String() ([]byte, error)
type JsonPrivatePublicMember ¶
type JsonPublicMember ¶
type JsonPublicMember struct { Clazz string `json:"clazz"` Member PublicKey string `json:"publicKey"` }
func ToJsonPublicMember ¶
func ToJsonPublicMember(pkms ...*PrivateMember) []*JsonPublicMember
func (*JsonPublicMember) String ¶
func (pm *JsonPublicMember) String() ([]byte, error)
type JsonPublicMemberSorter ¶
type JsonPublicMemberSorter struct { Values [](*JsonPublicMember) By func(p1, p2 *JsonPublicMember) bool // Closure used in the Less method. }
func (*JsonPublicMemberSorter) Len ¶
func (s *JsonPublicMemberSorter) Len() int
Len is part of sort.Interface.
func (*JsonPublicMemberSorter) Less ¶
func (s *JsonPublicMemberSorter) Less(i, j int) bool
Less is part of sort.Interface. It is implemented by calling the "by" closure in the sorter.
func (*JsonPublicMemberSorter) Swap ¶
func (s *JsonPublicMemberSorter) Swap(i, j int)
Swap is part of sort.Interface.
type Member ¶
type Member struct { MemberBase Id string `json:"id"` }
type MemberBase ¶
type MemberType ¶
type MemberType string
type PrivateMember ¶
type PrivateMember struct { Member PrivateKey key.PrivateKey }
func Filter ¶
func Filter(pkms []*PrivateMember, filters ...func(*PrivateMember) bool) []*PrivateMember
func FilterByType ¶
func FilterByType(pkms []*PrivateMember, typs ...MemberType) []*PrivateMember
func JsToPrivateMember ¶
func JsToPrivateMember(jspriv *JsonPrivateMember) (*PrivateMember, error)
func MakePrivateMember ¶
func MakePrivateMember(pm *PrivateMemberArg) (*PrivateMember, error)
func (*PrivateMember) AsJSON ¶
func (pm *PrivateMember) AsJSON() *JsonPrivateMember
func (*PrivateMember) Public ¶
func (pm *PrivateMember) Public() *PublicMember
type PrivateMemberArg ¶
type PrivateMemberArg struct { Member MemberArg PrivateKey *key.PrivateKey }
type PublicMember ¶
func JsToPublicMember ¶
func JsToPublicMember(jspub *JsonPublicMember) (*PublicMember, error)
func MakePublicMember ¶
func MakePublicMember(pm *PublicMember) (*PublicMember, error)
func (*PublicMember) AsJSON ¶
func (pm *PublicMember) AsJSON() *JsonPublicMember
type PublicMemberClaim ¶
type PublicMemberClaim struct { JsonPublicMember jwt.StandardClaims }
func VerifyJWT ¶
func VerifyJWT(pk *key.PrivateKey, tknStr string) (*PublicMemberClaim, *jwt.Token, error)
Click to show internal directories.
Click to hide internal directories.