datastore

package
v0.0.0-...-f30a32e Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

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

Datastore implementation for projectmanager using a PGSQL backend.

func NewDatastore

func NewDatastore(db *sqlx.DB) (*Datastore, error)

NewDatastore creates a new project manager Datastore.

func (*Datastore) CheckAvailability

func (d *Datastore) CheckAvailability(orgID uuid.UUID, projectName string) (bool, error)

CheckAvailability checks the database to see if the project is still available.

func (*Datastore) GetProjectByName

func (d *Datastore) GetProjectByName(orgID uuid.UUID, projectName string) (*ProjectInfo, error)

GetProjectByName gets the project based on the project name.

func (*Datastore) GetProjectForOrg

func (d *Datastore) GetProjectForOrg(orgID uuid.UUID) (*ProjectInfo, error)

GetProjectForOrg gets the project for a particular org specified by ID.

func (*Datastore) RegisterProject

func (d *Datastore) RegisterProject(orgID uuid.UUID, projectName string) error

RegisterProject assigs ownership of the project to a particular org name. Doing this on a project that already exists is an error.

type ProjectInfo

type ProjectInfo struct {
	OrgID       uuid.UUID `db:"org_id"`
	ProjectName string    `db:"project_name"`
}

ProjectInfo describes a specific project.

Jump to

Keyboard shortcuts

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