Documentation
¶
Index ¶
- Constants
- Variables
- func CreateBackupDBEntry(db *gorm.DB, bidingId string, userId string, name string, creds []byte) error
- func CreateOrUpdateUserConfigDbEntry(db *gorm.DB, userId string, attributes map[string]interface{}) error
- func CreatePresentationRequestDBEntry(db *gorm.DB, userId string, requestId string, ttl int, proofRequestId string) error
- func CreateRecordDBEntry(db *gorm.DB, userId string, event common.RecordEventType, msg string) error
- func CreateUserConnectioniDbEntry(db *gorm.DB, id string, remoteDid string) error
- func CreateUserSecretDbEntry(db *gorm.DB, id string, secretId string)
- func CreateUserSecretId(userId string) string
- func DeleteBackupById(db *gorm.DB, bindingId string) error
- func DeleteInvalidatedBackups(db *gorm.DB, userId string) error
- func DeletePresentationRequests(db *gorm.DB, userId string, requestIds []string) error
- func DeleteUserConnectioniDbEntry(db *gorm.DB, id string, remoteDid string) error
- func EnrichBackupDBEntry(db *gorm.DB, bidingId string, creds []byte) error
- func WithRecord(f common.EndpointHandler, ctx *gin.Context, env common.Env, ...) (any, error)
- type Backup
- type ContextKey
- type HistoryRecord
- type JSONB
- type PresentationRequest
- type UserConfig
- type UserConnection
- type UserSecret
Constants ¶
View Source
const SqlstateUniqueViolationState = "23505"
Variables ¶
View Source
var PresentationAlreadyExistsError = errors.New("presentation request already exists")
Functions ¶
func CreateBackupDBEntry ¶
func CreateRecordDBEntry ¶
func CreateUserSecretDbEntry ¶
func CreateUserSecretId ¶
func EnrichBackupDBEntry ¶
func WithRecord ¶
func WithRecord(f common.EndpointHandler, ctx *gin.Context, env common.Env, ev common.RecordEventType, msg string) (any, error)
WithRecord Decorator function to execute arbitrary function with populate a database with history record
Types ¶
type Backup ¶
type ContextKey ¶
type ContextKey string
const InvalidateContextKey ContextKey = "invalidate"
const SkipBeforeUpdateHookContextKey ContextKey = "skipHook"
type HistoryRecord ¶
type HistoryRecord struct { *gorm.Model UserId string `gorm:"user_id"` EventType common.RecordEventType `gorm:"event_type"` Message string `gorm:"message"` }
func GetRecords ¶
func GetRecords(db *gorm.DB, userId string) ([]HistoryRecord, error)
type PresentationRequest ¶
type PresentationRequest struct { *gorm.Model UserId string `gorm:"user_id"` RequestId string `gorm:"request_id"` ProofRequestId string `gorm:"proof_request_id"` TTL int `gorm:"ttl"` }
func GetAllPresentationRequests ¶
func GetAllPresentationRequests(db *gorm.DB, userId string) ([]PresentationRequest, error)
type UserConfig ¶
type UserConfig struct { gorm.Model UserID string `gorm:"user_id"` Attributes JSONB `gorm:"type:json;not null;default:'{}'"` }
func GetConfigByUserID ¶
func GetConfigByUserID(db *gorm.DB, userID string) (*UserConfig, error)
func (*UserConfig) CreateOrUpdateConfig ¶
func (u *UserConfig) CreateOrUpdateConfig(db *gorm.DB) error
type UserConnection ¶
type UserConnection struct { *gorm.Model UserId string `gorm:"user_id"` RemoteDid string `gorm:"remote_did"` }
type UserSecret ¶
type UserSecret struct { ID uint `gorm:"autoIncrement; not null; unique; index"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` // *gorm.Model is not embedded here to avoid colliding with UserId field UserId string `gorm:"user_id; unique; not null; primaryKey"` SecretId string `gorm:"secret_id"` }
func GetUserSecretIdDbEntry ¶
func GetUserSecretIdDbEntry(db *gorm.DB, id string) *UserSecret
Click to show internal directories.
Click to hide internal directories.