store

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAgent

func GetAgent(ctx context.Context, db DB) (*model.Agent, error)

func NewError added in v0.1.3

func NewError(code ErrCode, fmtString string, args ...interface{}) error

Types

type DB

type DB interface {
	GetListenerAgents(info *paginator.BatchInfo) (*model.Agents, error)
	Close()

	AddAgent(a *model.Agent) (*model.Agent, error)
	GetAgent(id, agentID *string) (*model.Agent, error)

	AddConnection(c *model.Connection) (*model.Connection, error)
	GetConnection(id, tenantID string) (*model.Connection, error)
	GetConnections(info *paginator.BatchInfo, tenantID string) (*model.Connections, error)
	GetConnectionCount(tenantID string) (int, error)
	ArchiveConnection(id, tenantID string) error

	AddCredential(c *model.Credential) (*model.Credential, error)
	UpdateCredential(c *model.Credential) (*model.Credential, error)
	GetCredential(id, tenantID string) (*model.Credential, error)
	GetCredentials(info *paginator.BatchInfo, tenantID string, connectionID *string) (*model.Credentials, error)
	GetCredentialCount(tenantID string, connectionID *string) (int, error)
	GetConnectionForCredential(id, tenantID string) (*model.Connection, error)
	ArchiveCredential(id, tenantID string) error
	SearchCredentials(tenantID string, proofAttributes []*graph.ProofAttribute) ([]*graph.ProvableAttribute, error)

	AddProof(p *model.Proof) (*model.Proof, error)
	UpdateProof(p *model.Proof) (*model.Proof, error)
	GetProof(id, tenantID string) (*model.Proof, error)
	GetProofs(info *paginator.BatchInfo, tenantID string, connectionID *string) (*model.Proofs, error)
	GetProofCount(tenantID string, connectionID *string) (int, error)
	GetConnectionForProof(id, tenantID string) (*model.Connection, error)
	ArchiveProof(id, tenantID string) error

	AddMessage(m *model.Message) (*model.Message, error)
	UpdateMessage(m *model.Message) (*model.Message, error)
	GetMessage(id, tenantID string) (*model.Message, error)
	GetMessages(info *paginator.BatchInfo, tenantID string, connectionID *string) (*model.Messages, error)
	GetMessageCount(tenantID string, connectionID *string) (int, error)
	GetConnectionForMessage(id, tenantID string) (*model.Connection, error)
	ArchiveMessage(id, tenantID string) error

	AddEvent(e *model.Event) (*model.Event, error)
	MarkEventRead(id, tenantID string) (*model.Event, error)
	GetEvent(id, tenantID string) (*model.Event, error)
	GetEvents(info *paginator.BatchInfo, tenantID string, connectionID *string) (*model.Events, error)
	GetEventCount(tenantID string, connectionID *string) (int, error)
	GetConnectionForEvent(id, tenantID string) (*model.Connection, error)
	GetJobForEvent(id, tenantID string) (*model.Job, error)
	GetJobOutput(id, tenantID string, protocolType graph.ProtocolType) (*model.JobOutput, error)

	AddJob(j *model.Job) (*model.Job, error)
	UpdateJob(j *model.Job) (*model.Job, error)
	GetJob(id, tenantID string) (*model.Job, error)
	GetJobs(info *paginator.BatchInfo, tenantID string, connectionID *string, completed *bool) (*model.Jobs, error)
	GetJobCount(tenantID string, connectionID *string, completed *bool) (int, error)
	GetConnectionForJob(id, tenantID string) (*model.Connection, error)
	GetOpenProofJobs(tenantID string, proofAttributes []*graph.ProofAttribute) ([]*model.Job, error)
}

type ErrCode added in v0.1.3

type ErrCode string
const (
	ErrCodeOk       ErrCode = "OK"
	ErrCodeNotFound ErrCode = "NOT_FOUND"
	ErrCodeUnknown  ErrCode = "UNKNOWN"
)

func ErrorCode added in v0.1.3

func ErrorCode(err error) ErrCode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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