repo

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddProjectMemberParams

type AddProjectMemberParams struct {
	ProjectID pgtype.UUID `json:"project_id"`
	UserID    pgtype.UUID `json:"user_id"`
	Role      string      `json:"role"`
}

type AuditLog

type AuditLog struct {
	ID           pgtype.UUID        `json:"id"`
	UserID       pgtype.UUID        `json:"user_id"`
	Action       string             `json:"action"`
	ResourceType string             `json:"resource_type"`
	ResourceID   pgtype.Text        `json:"resource_id"`
	Details      []byte             `json:"details"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
}

type CreateAuditLogParams

type CreateAuditLogParams struct {
	UserID       pgtype.UUID `json:"user_id"`
	Action       string      `json:"action"`
	ResourceType string      `json:"resource_type"`
	ResourceID   pgtype.Text `json:"resource_id"`
	Details      []byte      `json:"details"`
}

type CreateEnvironmentParams

type CreateEnvironmentParams struct {
	ProjectID pgtype.UUID `json:"project_id"`
	Name      string      `json:"name"`
	Slug      string      `json:"slug"`
}

type CreateProjectParams

type CreateProjectParams struct {
	Name        string      `json:"name"`
	Slug        string      `json:"slug"`
	Description pgtype.Text `json:"description"`
}

type CreateRefreshTokenParams

type CreateRefreshTokenParams struct {
	UserID    pgtype.UUID        `json:"user_id"`
	Token     string             `json:"token"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}

type CreateUserParams

type CreateUserParams struct {
	Email        string `json:"email"`
	PasswordHash string `json:"password_hash"`
	FullName     string `json:"full_name"`
}

type CreateVariableParams

type CreateVariableParams struct {
	EnvironmentID pgtype.UUID `json:"environment_id"`
	Key           string      `json:"key"`
	Value         string      `json:"value"`
	IsSecret      pgtype.Bool `json:"is_secret"`
	Path          string      `json:"path"`
}

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 DeleteVariableParams

type DeleteVariableParams struct {
	EnvironmentID pgtype.UUID `json:"environment_id"`
	Key           string      `json:"key"`
}

type Environment

type Environment struct {
	ID        pgtype.UUID        `json:"id"`
	ProjectID pgtype.UUID        `json:"project_id"`
	Name      string             `json:"name"`
	Slug      string             `json:"slug"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type GetProjectMemberParams

type GetProjectMemberParams struct {
	ProjectID pgtype.UUID `json:"project_id"`
	UserID    pgtype.UUID `json:"user_id"`
}

type ListProjectMembersRow

type ListProjectMembersRow struct {
	ProjectID pgtype.UUID        `json:"project_id"`
	UserID    pgtype.UUID        `json:"user_id"`
	Role      string             `json:"role"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	Email     string             `json:"email"`
	FullName  string             `json:"full_name"`
}

type ListProjectsRow

type ListProjectsRow struct {
	ID          pgtype.UUID        `json:"id"`
	Name        string             `json:"name"`
	Slug        string             `json:"slug"`
	Description pgtype.Text        `json:"description"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
	Role        string             `json:"role"`
}

type Project

type Project struct {
	ID          pgtype.UUID        `json:"id"`
	Name        string             `json:"name"`
	Slug        string             `json:"slug"`
	Description pgtype.Text        `json:"description"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
}

type ProjectMember

type ProjectMember struct {
	ProjectID pgtype.UUID        `json:"project_id"`
	UserID    pgtype.UUID        `json:"user_id"`
	Role      string             `json:"role"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type Querier

type Querier interface {
	AddProjectMember(ctx context.Context, arg AddProjectMemberParams) (ProjectMember, error)
	CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error)
	CreateEnvironment(ctx context.Context, arg CreateEnvironmentParams) (Environment, error)
	CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)
	CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (RefreshToken, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
	CreateVariable(ctx context.Context, arg CreateVariableParams) (Variable, error)
	DeleteEnvironment(ctx context.Context, id pgtype.UUID) error
	DeleteProject(ctx context.Context, id pgtype.UUID) error
	DeleteRefreshToken(ctx context.Context, token string) error
	DeleteUser(ctx context.Context, id pgtype.UUID) error
	DeleteVariable(ctx context.Context, arg DeleteVariableParams) error
	GetEnvironment(ctx context.Context, id pgtype.UUID) (Environment, error)
	GetProject(ctx context.Context, id pgtype.UUID) (Project, error)
	GetProjectMember(ctx context.Context, arg GetProjectMemberParams) (ProjectMember, error)
	GetRefreshToken(ctx context.Context, token string) (RefreshToken, error)
	GetUser(ctx context.Context, id pgtype.UUID) (User, error)
	GetUserByEmail(ctx context.Context, email string) (User, error)
	GetUserByResetToken(ctx context.Context, passwordResetToken pgtype.Text) (User, error)
	ListActiveRefreshTokensForUser(ctx context.Context, userID pgtype.UUID) ([]RefreshToken, error)
	ListEnvironments(ctx context.Context, projectID pgtype.UUID) ([]Environment, error)
	ListProjectMembers(ctx context.Context, projectID pgtype.UUID) ([]ListProjectMembersRow, error)
	ListProjects(ctx context.Context, userID pgtype.UUID) ([]ListProjectsRow, error)
	ListUsers(ctx context.Context) ([]User, error)
	ListVariables(ctx context.Context, environmentID pgtype.UUID) ([]Variable, error)
	RemoveProjectMember(ctx context.Context, arg RemoveProjectMemberParams) error
	RevokeRefreshToken(ctx context.Context, token string) error
	SetPasswordResetToken(ctx context.Context, arg SetPasswordResetTokenParams) error
	UpdateEnvironment(ctx context.Context, arg UpdateEnvironmentParams) (Environment, error)
	UpdatePassword(ctx context.Context, arg UpdatePasswordParams) error
	UpdateProject(ctx context.Context, arg UpdateProjectParams) (Project, error)
	UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
	UpdateVariable(ctx context.Context, arg UpdateVariableParams) (Variable, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddProjectMember

func (q *Queries) AddProjectMember(ctx context.Context, arg AddProjectMemberParams) (ProjectMember, error)

func (*Queries) CreateAuditLog

func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) (AuditLog, error)

func (*Queries) CreateEnvironment

func (q *Queries) CreateEnvironment(ctx context.Context, arg CreateEnvironmentParams) (Environment, error)

func (*Queries) CreateProject

func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error)

func (*Queries) CreateRefreshToken

func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (RefreshToken, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) CreateVariable

func (q *Queries) CreateVariable(ctx context.Context, arg CreateVariableParams) (Variable, error)

func (*Queries) DeleteEnvironment

func (q *Queries) DeleteEnvironment(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteProject

func (q *Queries) DeleteProject(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteRefreshToken

func (q *Queries) DeleteRefreshToken(ctx context.Context, token string) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteVariable

func (q *Queries) DeleteVariable(ctx context.Context, arg DeleteVariableParams) error

func (*Queries) GetEnvironment

func (q *Queries) GetEnvironment(ctx context.Context, id pgtype.UUID) (Environment, error)

func (*Queries) GetProject

func (q *Queries) GetProject(ctx context.Context, id pgtype.UUID) (Project, error)

func (*Queries) GetProjectMember

func (q *Queries) GetProjectMember(ctx context.Context, arg GetProjectMemberParams) (ProjectMember, error)

func (*Queries) GetRefreshToken

func (q *Queries) GetRefreshToken(ctx context.Context, token string) (RefreshToken, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserByResetToken

func (q *Queries) GetUserByResetToken(ctx context.Context, passwordResetToken pgtype.Text) (User, error)

func (*Queries) ListActiveRefreshTokensForUser

func (q *Queries) ListActiveRefreshTokensForUser(ctx context.Context, userID pgtype.UUID) ([]RefreshToken, error)

func (*Queries) ListEnvironments

func (q *Queries) ListEnvironments(ctx context.Context, projectID pgtype.UUID) ([]Environment, error)

func (*Queries) ListProjectMembers

func (q *Queries) ListProjectMembers(ctx context.Context, projectID pgtype.UUID) ([]ListProjectMembersRow, error)

func (*Queries) ListProjects

func (q *Queries) ListProjects(ctx context.Context, userID pgtype.UUID) ([]ListProjectsRow, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]User, error)

func (*Queries) ListVariables

func (q *Queries) ListVariables(ctx context.Context, environmentID pgtype.UUID) ([]Variable, error)

func (*Queries) RemoveProjectMember

func (q *Queries) RemoveProjectMember(ctx context.Context, arg RemoveProjectMemberParams) error

func (*Queries) RevokeRefreshToken

func (q *Queries) RevokeRefreshToken(ctx context.Context, token string) error

func (*Queries) SetPasswordResetToken

func (q *Queries) SetPasswordResetToken(ctx context.Context, arg SetPasswordResetTokenParams) error

func (*Queries) UpdateEnvironment

func (q *Queries) UpdateEnvironment(ctx context.Context, arg UpdateEnvironmentParams) (Environment, error)

func (*Queries) UpdatePassword

func (q *Queries) UpdatePassword(ctx context.Context, arg UpdatePasswordParams) error

func (*Queries) UpdateProject

func (q *Queries) UpdateProject(ctx context.Context, arg UpdateProjectParams) (Project, error)

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)

func (*Queries) UpdateVariable

func (q *Queries) UpdateVariable(ctx context.Context, arg UpdateVariableParams) (Variable, error)

func (*Queries) WithTx

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

type RefreshToken

type RefreshToken struct {
	ID        pgtype.UUID        `json:"id"`
	UserID    pgtype.UUID        `json:"user_id"`
	Token     string             `json:"token"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
	Revoked   pgtype.Bool        `json:"revoked"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type RemoveProjectMemberParams

type RemoveProjectMemberParams struct {
	ProjectID pgtype.UUID `json:"project_id"`
	UserID    pgtype.UUID `json:"user_id"`
}

type SetPasswordResetTokenParams

type SetPasswordResetTokenParams struct {
	Email                  string             `json:"email"`
	PasswordResetToken     pgtype.Text        `json:"password_reset_token"`
	PasswordResetExpiresAt pgtype.Timestamptz `json:"password_reset_expires_at"`
}

type UpdateEnvironmentParams

type UpdateEnvironmentParams struct {
	ID   pgtype.UUID `json:"id"`
	Name string      `json:"name"`
	Slug string      `json:"slug"`
}

type UpdatePasswordParams

type UpdatePasswordParams struct {
	ID           pgtype.UUID `json:"id"`
	PasswordHash string      `json:"password_hash"`
}

type UpdateProjectParams

type UpdateProjectParams struct {
	ID          pgtype.UUID `json:"id"`
	Name        string      `json:"name"`
	Slug        string      `json:"slug"`
	Description pgtype.Text `json:"description"`
}

type UpdateUserParams

type UpdateUserParams struct {
	ID           pgtype.UUID `json:"id"`
	Email        string      `json:"email"`
	PasswordHash string      `json:"password_hash"`
	FullName     string      `json:"full_name"`
}

type UpdateVariableParams

type UpdateVariableParams struct {
	EnvironmentID pgtype.UUID `json:"environment_id"`
	Key           string      `json:"key"`
	Value         string      `json:"value"`
	IsSecret      pgtype.Bool `json:"is_secret"`
	Path          string      `json:"path"`
}

type User

type User struct {
	ID                     pgtype.UUID        `json:"id"`
	Email                  string             `json:"email"`
	PasswordHash           string             `json:"password_hash"`
	FullName               string             `json:"full_name"`
	PasswordResetToken     pgtype.Text        `json:"password_reset_token"`
	PasswordResetExpiresAt pgtype.Timestamptz `json:"password_reset_expires_at"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
	UpdatedAt              pgtype.Timestamptz `json:"updated_at"`
}

type Variable

type Variable struct {
	ID            pgtype.UUID        `json:"id"`
	EnvironmentID pgtype.UUID        `json:"environment_id"`
	Key           string             `json:"key"`
	Value         string             `json:"value"`
	IsSecret      pgtype.Bool        `json:"is_secret"`
	Path          string             `json:"path"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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