repository

package
v0.0.0-...-8462ed8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NConvertPgInt8

func NConvertPgInt8(value pgtype.Int8) *int64

func NConvertPgTimestamp

func NConvertPgTimestamp(value pgtype.Timestamp) *time.Time

func NConvertUUID

func NConvertUUID(value pgtype.UUID) *uuid.UUID

func NewPgxConn

func NewPgxConn(ctx context.Context, config Config) (*pgxpool.Pool, error)

Types

type Config

type Config struct {
	Host, Name, Username, Password string
	Port                           int
}

type Connect

type Connect interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
	Begin(ctx context.Context) (pgx.Tx, error)
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DbTracer

type DbTracer struct{}

func (DbTracer) TraceQueryEnd

func (t DbTracer) TraceQueryEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryEndData)

func (DbTracer) TraceQueryStart

func (t DbTracer) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context

type File

type File struct {
	ID           int64
	UserID       int64
	ParentID     pgtype.Int8
	AttachmentID string
	CreatedAt    pgtype.Timestamp
	UpdatedAt    pgtype.Timestamp
	DeletedAt    pgtype.Timestamp
	Name         string
	OriginalName string
	Type         VpBackendFilesTypeEnum
	Ocr          []byte
}

type NullVpBackendFilesTypeEnum

type NullVpBackendFilesTypeEnum struct {
	VpBackendFilesTypeEnum VpBackendFilesTypeEnum
	Valid                  bool // Valid is true if VpBackendFilesTypeEnum is not NULL
}

func (*NullVpBackendFilesTypeEnum) Scan

func (ns *NullVpBackendFilesTypeEnum) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullVpBackendFilesTypeEnum) Value

Value implements the driver Valuer interface.

type NullVpBackendUsersStatusEnum

type NullVpBackendUsersStatusEnum struct {
	VpBackendUsersStatusEnum VpBackendUsersStatusEnum
	Valid                    bool // Valid is true if VpBackendUsersStatusEnum is not NULL
}

func (*NullVpBackendUsersStatusEnum) Scan

func (ns *NullVpBackendUsersStatusEnum) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullVpBackendUsersStatusEnum) Value

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) SqlcCreateFilesItem

func (q *Queries) SqlcCreateFilesItem(ctx context.Context, arg SqlcCreateFilesItemParams) (int64, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Repository

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

func NewRepo

func NewRepo(conn Connect) *Repository

func (*Repository) InTx

func (r *Repository) InTx(ctx context.Context, f func(tx pgx.Tx) error) error

type SqlcCreateFilesItemParams

type SqlcCreateFilesItemParams struct {
	UserID       int64
	ParentID     pgtype.Int8
	AttachmentID string
	CreatedAt    pgtype.Timestamp
	Type         VpBackendFilesTypeEnum
	Name         string
	OriginalName string
}

type User

type User struct {
	ID         int64
	KeycloakID pgtype.UUID
	CreatedAt  pgtype.Timestamp
	UpdatedAt  pgtype.Timestamp
	DeletedAt  pgtype.Timestamp
	Email      pgtype.Text
	Status     VpBackendUsersStatusEnum
}

type VpBackendFilesTypeEnum

type VpBackendFilesTypeEnum string
const (
	VpBackendFilesTypeEnumDoc  VpBackendFilesTypeEnum = "doc"
	VpBackendFilesTypeEnumDocx VpBackendFilesTypeEnum = "docx"
	VpBackendFilesTypeEnumPdf  VpBackendFilesTypeEnum = "pdf"
	VpBackendFilesTypeEnumPng  VpBackendFilesTypeEnum = "png"
	VpBackendFilesTypeEnumJpg  VpBackendFilesTypeEnum = "jpg"
	VpBackendFilesTypeEnumJpeg VpBackendFilesTypeEnum = "jpeg"
)

func (*VpBackendFilesTypeEnum) Scan

func (e *VpBackendFilesTypeEnum) Scan(src interface{}) error

type VpBackendUsersStatusEnum

type VpBackendUsersStatusEnum string
const (
	VpBackendUsersStatusEnumActive   VpBackendUsersStatusEnum = "active"
	VpBackendUsersStatusEnumDisabled VpBackendUsersStatusEnum = "disabled"
)

func (*VpBackendUsersStatusEnum) Scan

func (e *VpBackendUsersStatusEnum) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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