postgres

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package postgres contains the database implementation of clients repository layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migration

func Migration() *migrate.MemoryMigrationSource

Types

type Repository

type Repository interface {
	mgclients.Repository

	// Save persists the client account. A non-nil error is returned to indicate
	// operation failure.
	Save(ctx context.Context, client ...mgclients.Client) ([]mgclients.Client, error)

	// RetrieveBySecret retrieves a client based on the secret (key).
	RetrieveBySecret(ctx context.Context, key string) (mgclients.Client, error)

	// Delete deletes client with given id
	Delete(ctx context.Context, id string) error
}

Repository is the interface that wraps the basic methods for a client repository.

func NewRepository

func NewRepository(db postgres.Database) Repository

NewRepository instantiates a PostgreSQL implementation of Clients repository.

Jump to

Keyboard shortcuts

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