Documentation
¶
Index ¶
- Constants
- Variables
- func Complement(vs []string, ts []string) []string
- func Contains(vs []string, t string) bool
- func DefaultUrlMIME() *types.MIME
- func Ext(m *types.MIME) string
- func FileCount(p *types.Payload) int
- func Filter(vs []string, f func(string) bool) []string
- func GetNativeType(el *pb.ECGroupElement) *ec.GroupElement
- func GetNativeTypeFromCredReq(r *pb.CLCredReq) (*cl.CredRequest, error)
- func GetNativeTypeFromCredential(c *pb.CLCredential) (*cl.Cred, *qr.RepresentationProof, error)
- func GetNativeTypeFromPair(el *pb.Pair) *common.Pair
- func GetNativeTypeFromProveCredential(p *pb.ProveCLCredential) (*big.Int, *qr.RepresentationProof, []*big.Int, []*big.Int, []int, []int, error)
- func GetNativeTypeFromUpdateCredential(u *pb.UpdateCLCredential) (*big.Int, *big.Int, []*big.Int)
- func GetVerificationMethodType(vmType string) string
- func Header(f *types.FileItem) textproto.MIMEHeader
- func IndexOf(vs []string, t string) int
- func IsAudio(m *types.MIME) bool
- func IsDidFragment(prefix string, didUrl string) bool
- func IsFile(m *types.MIME) bool
- func IsFullDidFragment(prefix string, didUrl string) bool
- func IsImage(m *types.MIME) bool
- func IsMedia(m *types.MIME) bool
- func IsMultiple(p *types.Payload) (bool, error)
- func IsNotValidDIDArray(prefix string, array []string) (bool, int)
- func IsNotValidDIDArrayFragment(prefix string, array []string) (bool, int)
- func IsPDF(m *types.MIME) bool
- func IsSingle(p *types.Payload) (bool, error)
- func IsUrl(m *types.MIME) bool
- func IsValidDid(prefix string, did string) bool
- func IsValidNetworkPrefix(prefix string) bool
- func IsVideo(m *types.MIME) bool
- func Libp2pID(p *types.Peer) (peer.ID, error)
- func NewFileItem(path string, tbuf []byte) (*types.Payload_Item, error)
- func NewMime(path string) (*types.MIME, error)
- func NewThumbnail(path string, tbuf []byte, mime *types.MIME, ch chan *types.Thumbnail)
- func OLC(l *types.Location) string
- func OS(p *types.Peer) string
- func PermitsThumbnail(m *types.MIME) bool
- func PubKey(p *types.Peer) (crypto.PubKey, error)
- func SetPathFromFolder(f *types.FileItem, folder config.Folder) (string, error)
- func SplitDidUrlIntoDidAndFragment(didUrl string) (string, string)
- func ToPbCLCredential(c *cl.Cred, AProof *qr.RepresentationProof) *pb.CLCredential
- func ToPbCredRequest(r *cl.CredRequest) *pb.CLCredReq
- func ToPbECGroupElement(el *ec.GroupElement) *pb.ECGroupElement
- func ToPbPair(el *common.Pair) *pb.Pair
- func ToPbProveCLCredential(A *big.Int, proof *qr.RepresentationProof, ...) *pb.ProveCLCredential
- func ToPbUpdateCLCredential(nym, nonce *big.Int, newKnownAttrs []*big.Int) *pb.UpdateCLCredential
- func ToTransferItem(f *types.FileItem) *types.Payload_Item
- func URLCount(p *types.Payload) int
- type ClientStream
- type GetProfileFunc
- type PayloadItemFunc
- type PbConvertibleType
- type ServerStream
Constants ¶
const ( PublicKeyJwk = "PublicKeyJwk" PublicKeyMultibase = "PublicKeyMultibase" )
Variables ¶
var ( ErrFragmentAndQuery = errors.New("Unable to create new DID. Fragment and Query are mutually exclusive") ErrParseInvalid = errors.New("Unable to parse string into DID, invalid format.") )
var ( ErrParentDirNotExists = errors.New("FileItem's Parent Directory does not exist") ErrEmptyData = errors.New("Passed Buffer is Empty") )
var DidForbiddenSymbolsRegexp, _ = regexp.Compile(`^[^&\\]+$`)
var ValidNetworkPrefixes = []string{
"mainnet",
"testnet",
"devnet",
}
var VerificationMethodType = map[string]string{ "JsonWebKey2020": PublicKeyJwk, "Ed25519VerificationKey2020": PublicKeyMultibase, }
Functions ¶
func Complement ¶
Complement returns a new slice containing all strings from the slice that do not satisfy the predicate
func DefaultUrlMIME ¶
** ─────────────────────────────────────────────────────── ** ─── MIME Management ─────────────────────────────────── ** ─────────────────────────────────────────────────────── DefaultUrlMIME is the standard MIME type for URLs
func Filter ¶
Filter returns a new slice containing all strings from the slice that satisfy the predicate
func GetNativeType ¶
func GetNativeType(el *pb.ECGroupElement) *ec.GroupElement
func GetNativeTypeFromCredReq ¶
func GetNativeTypeFromCredReq(r *pb.CLCredReq) (*cl.CredRequest, error)
func GetNativeTypeFromCredential ¶
func GetNativeTypeFromCredential(c *pb.CLCredential) (*cl.Cred, *qr.RepresentationProof, error)
func GetVerificationMethodType ¶
GetVerificationMethodType returns the verification method type
func Header ¶
func Header(f *types.FileItem) textproto.MIMEHeader
Header returns the header of the FileItem
func IsDidFragment ¶
IsDidFragment checks if a DID fragment is valid
func IsFullDidFragment ¶
IsFullDidFragment checks if a DID fragment is for full string
func IsMultiple ¶
IsMultiple returns true if the transfer is a multiple transfer. Error returned if No Items present in Payload
func IsNotValidDIDArray ¶
IsNotValidDIDArray checks if a DID array is invalid
func IsNotValidDIDArrayFragment ¶
IsNotValidDIDArrayFragment checks if a DID array is invalid
func IsSingle ¶
IsSingle returns true if the transfer is a single transfer. Error returned if No Items present in Payload
func IsValidDid ¶
IsValidDid checks if a DID is valid
func IsValidNetworkPrefix ¶
func NewFileItem ¶
func NewFileItem(path string, tbuf []byte) (*types.Payload_Item, error)
NewFileItem creates a new transfer file item
func NewThumbnail ¶
NewThumbnail creates a new thumbnail for the given file
func PermitsThumbnail ¶
PermitsThumbnail Checks if Mime Type Allows Thumbnail Generation. Image, Video, Audio, and PDF are allowed.
func SetPathFromFolder ¶
SetPathFromFolder sets the path of the FileItem
func SplitDidUrlIntoDidAndFragment ¶
SplitDidUrlIntoDidAndFragment splits a DID URL into DID and fragment
func ToPbCLCredential ¶
func ToPbCLCredential(c *cl.Cred, AProof *qr.RepresentationProof) *pb.CLCredential
func ToPbCredRequest ¶
func ToPbCredRequest(r *cl.CredRequest) *pb.CLCredReq
func ToPbECGroupElement ¶
func ToPbECGroupElement(el *ec.GroupElement) *pb.ECGroupElement
func ToPbProveCLCredential ¶
func ToPbProveCLCredential(A *big.Int, proof *qr.RepresentationProof, knownAttrs, commitmentsOfAttrs []*big.Int, revealedKnownAttrsIndices, revealedCommitmentsOfAttrsIndices []int) *pb.ProveCLCredential
func ToPbUpdateCLCredential ¶
func ToTransferItem ¶
func ToTransferItem(f *types.FileItem) *types.Payload_Item
ToTransferItem Returns Transfer for FileItem
Types ¶
type ClientStream ¶
type ClientStream interface { Send(*pb.ZkMessage) error Recv() (*pb.ZkMessage, error) grpc.ClientStream }
ClientStream is an interface that fits all the auto-generated client stream interfaces declared within this package.
type GetProfileFunc ¶
GetProfileFunc returns a function that returns the Profile and error
type PayloadItemFunc ¶
type PayloadItemFunc func(item *types.Payload_Item, index int, total int) error
** ─────────────────────────────────────────────────────── ** ─── Payload Management ──────────────────────────────── ** ─────────────────────────────────────────────────────── PayloadItemFunc is the Map function for PayloadItem
type PbConvertibleType ¶
type PbConvertibleType interface {
GetNativeType() interface{}
}
type ServerStream ¶
type ServerStream interface { Send(*pb.ZkMessage) error Recv() (*pb.ZkMessage, error) grpc.ServerStream }
ServerStream is an interface that fits all the auto-generated server stream interfaces declared within this package.