-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f9e254
commit e508569
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package protocol | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/iden3/iden3comm/v2" | ||
) | ||
|
||
// GoalCode represents the goal code of targeted protocol message | ||
type GoalCode string | ||
|
||
const ( | ||
// ProposalRequest is the goal code for proposal request | ||
ProposalRequest GoalCode = "iden3comm.credentials.v1-1.proposal-request" | ||
) | ||
|
||
// GetProtocolMessageTypeByGoalCode returns the protocol message type by goal code | ||
func GetProtocolMessageTypeByGoalCode(goalCode GoalCode) (iden3comm.ProtocolMessage, error) { | ||
switch goalCode { | ||
case ProposalRequest: | ||
return CredentialProposalRequestMessageType, nil | ||
default: | ||
return "", fmt.Errorf("unknown goal code %s", goalCode) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters