repositories

package
v0.0.0-...-a5e1e4d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NeoErrNoRecordsMsg = "Result contains no more records"

Variables

View Source
var ErrNoRecord = errors.New("no record found")

Functions

This section is empty.

Types

type CertRepository

type CertRepository interface {
	CreateCert(
		ctx context.Context,
		userId string,
		name string,
		data []byte,
		certType string,
		parentCA string,
		keyId string,
	) (*daos.Certificate, error)

	DeleteCertByID(
		ctx context.Context,
		id string,
	) error

	GetCertByID(
		ctx context.Context,
		id string,
	) (*daos.Certificate, error)

	GetCertsByUserID(
		ctx context.Context,
		userId string,
		certTypes []string,
	) ([]*daos.Certificate, error)

	GetKeyIDByCertID(
		ctx context.Context,
		certID string,
	) (string, error)

	GetCertsByParentCA(
		ctx context.Context,
		parentCA string,
	) ([]*daos.Certificate, error)
}

type CertRepositoryMySQL

type CertRepositoryMySQL struct {
	// contains filtered or unexported fields
}

func NewCertRepositoryMySQL

func NewCertRepositoryMySQL(db *gorm.DB) *CertRepositoryMySQL

func (*CertRepositoryMySQL) CreateCert

func (c *CertRepositoryMySQL) CreateCert(
	ctx context.Context,
	userId string,
	name string,
	data []byte,
	certType string,
	parentCA string,
	keyId string,
) (*daos.Certificate, error)

func (*CertRepositoryMySQL) DeleteCertByID

func (c *CertRepositoryMySQL) DeleteCertByID(ctx context.Context, id string) error

func (*CertRepositoryMySQL) GetCertByID

func (c *CertRepositoryMySQL) GetCertByID(ctx context.Context, id string) (
	*daos.Certificate,
	error,
)

func (*CertRepositoryMySQL) GetCertsByParentCA

func (c *CertRepositoryMySQL) GetCertsByParentCA(
	ctx context.Context,
	parentCA string,
) ([]*daos.Certificate, error)

func (*CertRepositoryMySQL) GetCertsByUserID

func (c *CertRepositoryMySQL) GetCertsByUserID(
	ctx context.Context,
	userId string,
	certTypes []string,
) ([]*daos.Certificate, error)

func (*CertRepositoryMySQL) GetKeyIDByCertID

func (c *CertRepositoryMySQL) GetKeyIDByCertID(ctx context.Context, certID string) (string, error)

type KeyRepository

type KeyRepository interface {
	CreateKey(
		ctx context.Context,
		userId string,
		data []byte,
		algorithm string,
		name string,
	) (*daos.Key, error)
	GetKey(ctx context.Context, id string) (*daos.Key, error)
	GetKeysForUser(
		ctx context.Context,
		userId string,
	) ([]*daos.Key, error)
}

type KeyRepositoryMySQL

type KeyRepositoryMySQL struct {
	// contains filtered or unexported fields
}

func NewKeyRepositoryMySQL

func NewKeyRepositoryMySQL(db *gorm.DB) *KeyRepositoryMySQL

func (*KeyRepositoryMySQL) CreateKey

func (k *KeyRepositoryMySQL) CreateKey(
	ctx context.Context,
	userId string,
	data []byte,
	algorithm string,
	name string,
) (*daos.Key, error)

func (*KeyRepositoryMySQL) GetKey

func (k *KeyRepositoryMySQL) GetKey(ctx context.Context, id string) (*daos.Key, error)

func (*KeyRepositoryMySQL) GetKeysForUser

func (k *KeyRepositoryMySQL) GetKeysForUser(ctx context.Context, userId string) (
	[]*daos.Key,
	error,
)

type UserRepository

type UserRepository interface {
	CleanupSessions(ctx context.Context) (int, error)
	CreateSession(ctx context.Context, userID string) (*contracts.SessionResponse, error)
	CreateUser(ctx context.Context, user *contracts.CreateUserRequest) (*daos.User, error)
	GetUserByEmail(ctx context.Context, email string) (*daos.User, error)
	GetUserBySessionID(ctx context.Context, sessionID string) (*daos.User, error)
}

type UserRepositoryMySql

type UserRepositoryMySql struct {
	// contains filtered or unexported fields
}

func NewUserRepositoryMySql

func NewUserRepositoryMySql(db *gorm.DB) *UserRepositoryMySql

func (*UserRepositoryMySql) CleanupSessions

func (u *UserRepositoryMySql) CleanupSessions(ctx context.Context) (int, error)

func (*UserRepositoryMySql) CreateSession

func (u *UserRepositoryMySql) CreateSession(
	ctx context.Context,
	userID string,
) (*contracts.SessionResponse, error)

func (*UserRepositoryMySql) CreateUser

func (u *UserRepositoryMySql) CreateUser(
	ctx context.Context,
	createUser *contracts.CreateUserRequest,
) (*daos.User, error)

func (*UserRepositoryMySql) GetUserByEmail

func (u *UserRepositoryMySql) GetUserByEmail(ctx context.Context, email string) (
	*daos.User,
	error,
)

func (*UserRepositoryMySql) GetUserBySessionID

func (u *UserRepositoryMySql) GetUserBySessionID(ctx context.Context, sessionID string) (
	*daos.User,
	error,
)

type UserRepositoryNeo4j

type UserRepositoryNeo4j struct {
	// contains filtered or unexported fields
}

func NewUserRepositoryNeo4j

func NewUserRepositoryNeo4j(driver neo4j.Driver) *UserRepositoryNeo4j

func (*UserRepositoryNeo4j) CleanupSessions

func (r *UserRepositoryNeo4j) CleanupSessions(ctx context.Context) (int, error)

func (*UserRepositoryNeo4j) CreateSession

func (r *UserRepositoryNeo4j) CreateSession(
	ctx context.Context,
	userID string,
) (*contracts.SessionResponse, error)

func (*UserRepositoryNeo4j) CreateUser

func (r *UserRepositoryNeo4j) CreateUser(
	ctx context.Context,
	createUser *contracts.CreateUserRequest,
) (*daos.User, error)

func (*UserRepositoryNeo4j) GetUserByEmail

func (r *UserRepositoryNeo4j) GetUserByEmail(ctx context.Context, email string) (
	*daos.User,
	error,
)

func (*UserRepositoryNeo4j) GetUserBySessionID

func (r *UserRepositoryNeo4j) GetUserBySessionID(ctx context.Context, sessionID string) (
	*daos.User,
	error,
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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