Documentation ¶
Index ¶
- func CreateProject(ctx context.Context, tx *pachsql.Tx, project *pfs.ProjectInfo) error
- func DeleteProject(ctx context.Context, tx *pachsql.Tx, projectName string) error
- func GetProject(ctx context.Context, tx *pachsql.Tx, id ProjectID) (*pfs.ProjectInfo, error)
- func GetProjectByName(ctx context.Context, tx *pachsql.Tx, projectName string) (*pfs.ProjectInfo, error)
- func IsErrProjectAlreadyExists(err error) bool
- func UpdateProject(ctx context.Context, tx *pachsql.Tx, id ProjectID, project *pfs.ProjectInfo) error
- func UpsertProject(ctx context.Context, tx *pachsql.Tx, project *pfs.ProjectInfo) error
- type ErrProjectAlreadyExists
- type ErrProjectNotFound
- type Project
- type ProjectID
- type ProjectIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProject ¶
CreateProject creates an entry in the core.projects table.
func DeleteProject ¶
DeleteProject deletes an entry in the core.projects table.
func GetProject ¶
GetProject is like GetProjectByName, but retrieves an entry using the row id.
func GetProjectByName ¶
func GetProjectByName(ctx context.Context, tx *pachsql.Tx, projectName string) (*pfs.ProjectInfo, error)
GetProjectByName retrieves an entry from the core.projects table by project name.
func UpdateProject ¶
func UpdateProject(ctx context.Context, tx *pachsql.Tx, id ProjectID, project *pfs.ProjectInfo) error
UpdateProject overwrites an existing project entry by ID.
func UpsertProject ¶
UpsertProject updates all fields of an existing project entry in the core.projects table by name. If 'upsert' is set to true, UpsertProject() will attempt to call CreateProject() if the entry does not exist.
Types ¶
type ErrProjectAlreadyExists ¶
type ErrProjectAlreadyExists struct {
Name string
}
ErrProjectAlreadyExists is returned by CreateProject() when a project with the same name already exists in postgres.
func (ErrProjectAlreadyExists) Error ¶
func (err ErrProjectAlreadyExists) Error() string
Error satisfies the error interface.
func (ErrProjectAlreadyExists) GRPCStatus ¶
func (err ErrProjectAlreadyExists) GRPCStatus() *status.Status
func (ErrProjectAlreadyExists) Is ¶
func (err ErrProjectAlreadyExists) Is(other error) bool
type ErrProjectNotFound ¶
ErrProjectNotFound is returned by GetProject() when a project is not found in postgres.
func (ErrProjectNotFound) Error ¶
func (err ErrProjectNotFound) Error() string
Error satisfies the error interface.
func (ErrProjectNotFound) GRPCStatus ¶
func (err ErrProjectNotFound) GRPCStatus() *status.Status
func (ErrProjectNotFound) Is ¶
func (err ErrProjectNotFound) Is(other error) bool
type Project ¶
type ProjectID ¶
type ProjectID uint64
ProjectID is the row id for a repo entry in postgres. A separate type is defined for safety so row ids must be explicitly cast for use in another table.
type ProjectIterator ¶
type ProjectIterator struct {
// contains filtered or unexported fields
}
ProjectIterator batches a page of projectRow entries. Entries can be retrieved using iter.Next().
func ListProject ¶
ListProject returns a ProjectIterator that exposes a Next() function for retrieving *pfs.ProjectInfo references.
func (*ProjectIterator) Next ¶
func (iter *ProjectIterator) Next(ctx context.Context, dst **pfs.ProjectInfo) error
Next advances the iterator by one row. It returns a stream.EOS when there are no more entries.