Documentation
¶
Index ¶
- func ExistsWithName(ctx context.Context, name string, store stores.Store) bool
- func ExistsWithUUID(ctx context.Context, uuid string, store stores.Store) bool
- func GetNameByUUID(ctx context.Context, uuid string, store stores.Store) string
- func GetUUIDByName(ctx context.Context, name string, store stores.Store) string
- func HasProject(ctx context.Context, name string, store stores.Store) bool
- func RemoveProject(ctx context.Context, uuid string, store stores.Store) error
- type Project
- func CreateProject(ctx context.Context, uuid string, name string, createdOn time.Time, ...) (Project, error)
- func GetFromJSON(input []byte) (Project, error)
- func NewProject(uuid string, name string, createdOn time.Time, modifiedOn time.Time, ...) Project
- func UpdateProject(ctx context.Context, uuid string, name string, description string, ...) (Project, error)
- type Projects
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExistsWithName ¶
ExistsWithName returns true if a project with name exists
func ExistsWithUUID ¶
ExistsWithUUID return true if a project with uuid exists
func GetNameByUUID ¶
GetNameByUUID queries projects by UUID and returns the project name. If not found, returns an empty string
func GetUUIDByName ¶
GetUUIDByName queries project by name and returns the corresponding UUID
func HasProject ¶
HasProject if store contains a project with the specific name
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 ¶
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 ¶
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 ¶
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) ExportJSON ¶
ExportJSON exports Projects list to json format