projects

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExistsWithName

func ExistsWithName(ctx context.Context, name string, store stores.Store) bool

ExistsWithName returns true if a project with name exists

func ExistsWithUUID

func ExistsWithUUID(ctx context.Context, uuid string, store stores.Store) bool

ExistsWithUUID return true if a project with uuid exists

func GetNameByUUID

func GetNameByUUID(ctx context.Context, uuid string, store stores.Store) string

GetNameByUUID queries projects by UUID and returns the project name. If not found, returns an empty string

func GetUUIDByName

func GetUUIDByName(ctx context.Context, name string, store stores.Store) string

GetUUIDByName queries project by name and returns the corresponding UUID

func HasProject

func HasProject(ctx context.Context, name string, store stores.Store) bool

HasProject if store contains a project with the specific name

func RemoveProject

func RemoveProject(ctx context.Context, uuid string, store stores.Store) error

RemoveProject removes project

Types

type Project

type Project struct {
	UUID        string `json:"-"`
	Name        string `json:"name,omitempty"`
	CreatedOn   string `json:"created_on,omitempty"`
	ModifiedOn  string `json:"modified_on,omitempty"`
	CreatedBy   string `json:"created_by,omitempty"`
	Description string `json:"description,omitempty"`
}

Project is the struct that holds ProjectUUID information

func CreateProject

func CreateProject(ctx context.Context, uuid string, name string, createdOn time.Time, createdBy string, description string, store stores.Store) (Project, error)

CreateProject creates a new project

func GetFromJSON

func GetFromJSON(input []byte) (Project, error)

GetFromJSON retrieves ProjectUUID info From JSON string

func NewProject

func NewProject(uuid string, name string, createdOn time.Time, modifiedOn time.Time, createdBy string, description string) Project

NewProject accepts parameters and creates a new project

func UpdateProject

func UpdateProject(ctx context.Context, uuid string, name string, description string, modifiedOn time.Time, store stores.Store) (Project, error)

UpdateProject creates a new project

func (*Project) ExportJSON

func (p *Project) ExportJSON() (string, error)

ExportJSON exports ProjectUUID to json format

type Projects

type Projects struct {
	List []Project `json:"projects,omitempty"`
}

Projects holds a list of available projects

func Find

func Find(ctx context.Context, uuid string, name string, store stores.Store) (Projects, error)

Find returns a specific project or a list of all available projects in the datastore. To return all projects use an empty project string parameter

func (*Projects) Empty

func (ps *Projects) Empty() bool

Empty returns true if projects list is empty

func (*Projects) ExportJSON

func (ps *Projects) ExportJSON() (string, error)

ExportJSON exports Projects list to json format

func (*Projects) One

func (ps *Projects) One() Project

One returns the first project if a projects list is not empty

Jump to

Keyboard shortcuts

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