message

package
v0.0.0-...-0cb9d36 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCEED_CODE     = 0
	ERROR_CODE_INNER = 500
)
View Source
const (
	InvitationInit ConnectionState = iota
	InvitationUsed
	ConnectionRequestSent
	ConnectionRequestReceived
	ConnectionResponseReceived
	ConnectionACKReceived

	RequestCredentialReceived RequestCredentialState = iota
	RequestCredentialResolved

	CredentialIssued CredentialState = iota
	CredentialReceive

	RequestPresentationReceived RequestPresentationState = iota
	RequestPresentationResolved
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Id          string    `json:"@id,omitempty"`
	Description string    `json:"description,omitempty"`
	FileName    string    `json:"filename,omitempty"`
	MimeType    string    `json:"mime_type,omitempty"`
	LastModTime time.Time `json:"lastmod_time,omitempty"`
	ByteCount   int64     `json:"byte_count,omitempty"`
	Data        Data      `json:"data,omitempty"`
}

type Attributre

type Attributre struct {
	Name      string `json:"name,omitempty"`
	MimeType  string `json:"mime_type,omitempty"`
	Value     string `json:"value,omitempty"`
	CredDefId string `json:"cred_def_id,omitempty"`
	// contains filtered or unexported fields
}

type BasicMessage

type BasicMessage struct {
	Type       string     `json:"@type"`
	Id         string     `json:"@id"`
	SendTime   time.Time  `json:"send_time"`
	Content    string     `json:"content"`
	I10n       I10n       `json:"~I10n"`
	Connection Connection `json:"connection,omitempty"`
}

func (*BasicMessage) GetConnection

func (self *BasicMessage) GetConnection() *Connection

type BasicMsgRec

type BasicMsgRec struct {
	Msglist []BasicMessage `json:"msglist"`
}

type Connection

type Connection struct {
	MyDid       string   `json:"my_did,omitempty"`
	MyRouter    []string `json:"my_router"`
	TheirDid    string   `json:"their_did"`
	TheirRouter []string `json:"their_router"`
}

type ConnectionACK

type ConnectionACK struct {
	Type       string     `json:"@type,omitempty"`
	Id         string     `json:"@id,omitempty"`
	Thread     Thread     `json:"~thread,omitempty"`
	Status     string     `json:"status,omitempty"`
	Connection Connection `json:"connection,omitempty"`
}

func (*ConnectionACK) GetConnection

func (self *ConnectionACK) GetConnection() *Connection

type ConnectionRec

type ConnectionRec struct {
	OwnerDID    string                `json:"owner_did"`
	Connections map[string]Connection `json:"connections"`
}

type ConnectionRequest

type ConnectionRequest struct {
	Type         string     `json:"@type,omitempty"`
	Id           string     `json:"@id,omitempty"`
	Label        string     `json:"label,omitempty"`
	Connection   Connection `json:"connection,omitempty"`
	InvitationId string     `json:"invitation_id"`
}

func (*ConnectionRequest) GetConnection

func (self *ConnectionRequest) GetConnection() *Connection

type ConnectionRequestRec

type ConnectionRequestRec struct {
	ConnReq ConnectionRequest `json:"conn_req"`
	State   ConnectionState   `json:"state"`
}

type ConnectionResponse

type ConnectionResponse struct {
	Type       string     `json:"@type,omitempty"`
	Id         string     `json:"@id,omitempty"`
	Thread     Thread     `json:"~thread,omitempty"`
	Connection Connection `json:"connection,omitempty"`
}

func (*ConnectionResponse) GetConnection

func (self *ConnectionResponse) GetConnection() *Connection

type ConnectionState

type ConnectionState int

type CredentialACK

type CredentialACK struct {
	Type       string     `json:"@type,omitempty"`
	Id         string     `json:"@id,omitempty"`
	Thread     Thread     `json:"~thread,omitempty"`
	Status     string     `json:"status,omitempty"`
	Connection Connection `json:"connection,omitempty"`
}

func (*CredentialACK) GetConnection

func (self *CredentialACK) GetConnection() *Connection

type CredentialPreview

type CredentialPreview struct {
	Type       string       `json:"@type,omitempty"`
	Attributre []Attributre `json:"attributre,omitempty"`
}

type CredentialRec

type CredentialRec struct {
	OwnerDID   string          `json:"owner_did"`
	Credential IssueCredential `json:"credential"`
	Timestamp  time.Time       `json:"timestamp"`
}

type CredentialState

type CredentialState int

type DIDDoc

type DIDDoc struct {
	Context        []string     `json:"@context"`
	Id             string       `json:"id"`
	PublicKey      interface{}  `json:"publicKey"`
	Authentication interface{}  `json:"authentication"`
	Controller     interface{}  `json:"controller"`
	Recovery       interface{}  `json:"recovery"`
	Service        []ServiceDoc `json:"service"`
	Attribute      interface{}  `json:"attribute"`
	Created        interface{}  `json:"created"`
	Updated        interface{}  `json:"updated"`
	Proof          interface{}  `json:"proof"`
}

func (DIDDoc) GetServicePoint

func (d DIDDoc) GetServicePoint(serviceID string) (string, error)

type Data

type Data struct {
	Sha256 string      `json:"sha256,omitempty"`
	Links  []string    `json:"links,omitempty"`
	Base64 string      `json:"base64,omitempty"`
	JSON   interface{} `json:"json,omitempty"`
}

type DeleteCredentialRequest

type DeleteCredentialRequest struct {
	DId string `json:"did"`
	Id  string `json:"id"`
}

func (*DeleteCredentialRequest) GetConnection

func (self *DeleteCredentialRequest) GetConnection() *Connection

type DeletePresentationRequest

type DeletePresentationRequest struct {
	DId string `json:"did"`
	Id  string `json:"id"`
}

func (*DeletePresentationRequest) GetConnection

func (self *DeletePresentationRequest) GetConnection() *Connection

type DisconnectRequest

type DisconnectRequest struct {
	Type       string     `json:"@type,omitempty"`
	Id         string     `json:"@id,omitempty"`
	Connection Connection `json:"connection,omitempty"`
}

func (*DisconnectRequest) GetConnection

func (self *DisconnectRequest) GetConnection() *Connection

type Format

type Format struct {
	AttachID string `json:"attach_id,omitempty"`
	Format   string `json:"format,omitempty"`
}

type ForwardMessageRequest

type ForwardMessageRequest struct {
	MsgType    int        `json:"msg_type"`
	Data       []byte     `json:"data"`
	Connection Connection `json:"connection"`
}

func (*ForwardMessageRequest) GetConnection

func (self *ForwardMessageRequest) GetConnection() *Connection

type I10n

type I10n struct {
	Locale string `json:"locale"`
}

type Invitation

type Invitation struct {
	Type   string   `json:"@type,omitempty"`
	Id     string   `json:"@id,omitempty"`
	Label  string   `json:"label,omitempty"`
	Did    string   `json:"did,omitempty"`
	Router []string `json:"router"`
}

func (*Invitation) GetConnection

func (self *Invitation) GetConnection() *Connection

type InvitationRec

type InvitationRec struct {
	Invitation Invitation      `json:"invitation"`
	State      ConnectionState `json:"state"`
}

type IssueCredential

type IssueCredential struct {
	Type              string       `json:"@type,omitempty"`
	Id                string       `json:"@id"`
	Comment           string       `json:"comment,omitempty"`
	Formats           []Format     `json:"formats,omitempty"`
	CredentialsAttach []Attachment `json:"credentials~attach,omitempty"`
	Connection        Connection   `json:"connection,omitempty"`
	Thread            Thread       `json:"~thread,omitempty"`
}

func (*IssueCredential) GetConnection

func (self *IssueCredential) GetConnection() *Connection

type OfferCredential

type OfferCredential struct {
	Type              string            `json:"@type,omitempty"`
	Id                string            `json:"@id,omitempty"`
	Comment           string            `json:"comment,omitempty"`
	CredentialPreview CredentialPreview `json:"credential_preview,omitempty"`
	OffersAttach      []Attachment      `json:"offers_attach,omitempty"`
	Connection        Connection        `json:"connection,omitempty"`
	Thread            Thread            `json:"~thread,omitempty"`
}

func (*OfferCredential) GetConnection

func (self *OfferCredential) GetConnection() *Connection

type Presentation

type Presentation struct {
	Type               string       `json:"@type,omitempty"`
	Id                 string       `json:"@id,omitempty"`
	Comment            string       `json:"comment,omitempty"`
	Formats            []Format     `json:"formats,omitempty"`
	PresentationAttach []Attachment `json:"presentations~attach,omitempty"`
	Connection         Connection   `json:"connection,omitempty"`
	Thread             Thread       `json:"~thread,omitempty"`
}

func (*Presentation) GetConnection

func (self *Presentation) GetConnection() *Connection

type PresentationACK

type PresentationACK struct {
	Type       string     `json:"@type,omitempty"`
	Id         string     `json:"@id,omitempty"`
	Thread     Thread     `json:"~thread,omitempty"`
	Status     string     `json:"status,omitempty"`
	Connection Connection `json:"connection,omitempty"`
}

func (*PresentationACK) GetConnection

func (self *PresentationACK) GetConnection() *Connection

type PresentationRec

type PresentationRec struct {
	OwnerDID     string       `json:"owner_did"`
	Presentation Presentation `json:"presentation"`
	Timestamp    time.Time    `json:"timestamp"`
}

type ProposalCredential

type ProposalCredential struct {
	Type               string            `json:"@type,omitempty"`
	Id                 string            `json:"@id,omitempty"`
	Comment            string            `json:"comment,omitempty"`
	CredentialProposal CredentialPreview `json:"credential_proposal,omitempty"`
	Connection         Connection        `json:"connection,omitempty"`
}

issue credential

func (*ProposalCredential) GetConnection

func (self *ProposalCredential) GetConnection() *Connection

type ProposePresentation

type ProposePresentation struct {
	Type          string       `json:"@type,omitempty"`
	Id            string       `json:"@id,omitempty"`
	Comment       string       `json:"comment,omitempty"`
	Formats       []Format     `json:"formats,omitempty"`
	ProposeAttach []Attachment `json:"propose~attach,omitempty"`
}

present proof

type QueryBasicMessageRequest

type QueryBasicMessageRequest struct {
	DID             string `json:"did"`
	Latest          bool   `json:"latest"`
	RemoveAfterRead bool   `json:"remove_after_read"`
}

func (*QueryBasicMessageRequest) GetConnection

func (self *QueryBasicMessageRequest) GetConnection() *Connection

type QueryConnectionsRequest

type QueryConnectionsRequest struct {
	DID string `json:"did"`
}

func (*QueryConnectionsRequest) GetConnection

func (q *QueryConnectionsRequest) GetConnection() *Connection

type QueryCredentialRequest

type QueryCredentialRequest struct {
	DId string `json:"did"`
	Id  string `json:"id"`
}

func (*QueryCredentialRequest) GetConnection

func (self *QueryCredentialRequest) GetConnection() *Connection

type QueryCredentialResponse

type QueryCredentialResponse struct {
	Formats           []Format     `json:"formats,omitempty"`
	CredentialsAttach []Attachment `json:"credentials~attach,omitempty"`
}

func (*QueryCredentialResponse) GetConnection

func (self *QueryCredentialResponse) GetConnection() *Connection

type QueryPresentationRequest

type QueryPresentationRequest struct {
	DId string `json:"did"`
	Id  string `json:"id"`
}

func (*QueryPresentationRequest) GetConnection

func (self *QueryPresentationRequest) GetConnection() *Connection

type QueryPresentationResponse

type QueryPresentationResponse struct {
	Formats            []Format     `json:"formats,omitempty"`
	PresentationAttach []Attachment `json:"presentations~attach,omitempty"`
}

func (*QueryPresentationResponse) GetConnection

func (self *QueryPresentationResponse) GetConnection() *Connection

type RequestCredential

type RequestCredential struct {
	Type           string       `json:"@type"`
	Id             string       `json:"@id"`
	Comment        string       `json:"comment"`
	Formats        []Format     `json:"formats,omitempty"`
	RequestsAttach []Attachment `json:"requests_attach"`
	Connection     Connection   `json:"connection,omitempty"`
}

func (*RequestCredential) GetConnection

func (self *RequestCredential) GetConnection() *Connection

type RequestCredentialRec

type RequestCredentialRec struct {
	RequesterDID      string                 `json:"requester_did"`
	RequestCredential RequestCredential      `json:"request_credential"`
	State             RequestCredentialState `json:"state"`
}

type RequestCredentialState

type RequestCredentialState int

type RequestInf

type RequestInf interface {
	GetConnection() *Connection
}

type RequestPresentation

type RequestPresentation struct {
	Type                      string       `json:"@type,omitempty"`
	Id                        string       `json:"@id,omitempty"`
	Comment                   string       `json:"comment,omitempty"`
	Formats                   []Format     `json:"formats,omitempty"`
	RequestPresentationAttach []Attachment `json:"request_presentation_attach,omitempty"`
	Connection                Connection   `json:"connection,omitempty"`
}

func (*RequestPresentation) GetConnection

func (self *RequestPresentation) GetConnection() *Connection

type RequestPresentationRec

type RequestPresentationRec struct {
	RequesterDID       string                   `json:"requester_did"`
	RerquestPrentation RequestPresentation      `json:"rerquest_prentation"`
	State              RequestPresentationState `json:"state"`
}

type RequestPresentationState

type RequestPresentationState int

type ServiceDoc

type ServiceDoc struct {
	ServiceID       string `json:"id"`
	ServiceType     string `json:"type"`
	ServiceEndpoint string `json:"serviceEndpoint"`
}

type Thread

type Thread struct {
	ID             string         `json:"thid,omitempty"`
	PID            string         `json:"pthid,omitempty"`
	SenderOrder    int            `json:"sender_order,omitempty"`
	ReceivedOrders map[string]int `json:"received_orders,omitempty"`
}

Thread thread data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL