postgres

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 22 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"`
	ParentGroupPath           sql.NullString   `db:"parent_group_path,omitempty"`
	RoleID                    string           `db:"role_id,omitempty"`
	RoleName                  string           `db:"role_name,omitempty"`
	Actions                   pq.StringArray   `db:"actions,omitempty"`
	AccessType                string           `db:"access_type,omitempty"`
	AccessProviderId          string           `db:"access_provider_id,omitempty"`
	AccessProviderRoleId      string           `db:"access_provider_role_id,omitempty"`
	AccessProviderRoleName    string           `db:"access_provider_role_name,omitempty"`
	AccessProviderRoleActions pq.StringArray   `db:"access_provider_role_actions,omitempty"`
	ConnectionTypes           pq.Int32Array    `db:"connection_types,omitempty"`
	MemberID                  string           `db:"member_id,omitempty"`
	Roles                     json.RawMessage  `db:"roles,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