postgres

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 17 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, error)

func NewRepository

func NewRepository(db postgres.Database) clients.Repository

NewRepository instantiates a PostgreSQL implementation of Clients repository.

func PageQuery

func PageQuery(pm clients.Page) (string, error)

func ToClient

func ToClient(t DBClient) (clients.Client, error)

func ToDBClientsPage

func ToDBClientsPage(pm clients.Page) (dbClientsPage, error)

Types

type DBClient

type DBClient struct {
	ID          string           `db:"id"`
	Name        string           `db:"name,omitempty"`
	Tags        pgtype.TextArray `db:"tags,omitempty"`
	Identity    string           `db:"identity"`
	Domain      string           `db:"domain_id"`
	ParentGroup sql.NullString   `db:"parent_group_id,omitempty"`
	Secret      string           `db:"secret"`
	Metadata    []byte           `db:"metadata,omitempty"`
	CreatedAt   time.Time        `db:"created_at,omitempty"`
	UpdatedAt   sql.NullTime     `db:"updated_at,omitempty"`
	UpdatedBy   *string          `db:"updated_by,omitempty"`
	Status      clients.Status   `db:"status,omitempty"`
}

func ToDBClient

func ToDBClient(c clients.Client) (DBClient, error)

Jump to

Keyboard shortcuts

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