Documentation ¶
Index ¶
- func ExistsWithName(name string, store stores.Store) bool
- func ExistsWithUUID(uuid string, store stores.Store) bool
- func GetNameByUUID(uuid string, store stores.Store) string
- func GetUUIDByName(name string, store stores.Store) string
- func HasProject(name string, store stores.Store) bool
- func RemoveProject(uuid string, store stores.Store) error
- type Project
- func CreateProject(uuid string, name string, createdOn time.Time, createdBy string, ...) (Project, error)
- func GetFromJSON(input []byte) (Project, error)
- func NewProject(uuid string, name string, createdOn time.Time, modifiedOn time.Time, ...) Project
- func UpdateProject(uuid string, name string, description string, modifiedOn time.Time, ...) (Project, error)
- type ProjectMessageCount
- type Projects
- type TotalProjectsMessageCount
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"` }
ProjectUUID is the struct that holds ProjectUUID information
func CreateProject ¶
func CreateProject(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(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 ProjectMessageCount ¶
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
type TotalProjectsMessageCount ¶
type TotalProjectsMessageCount struct { Projects []ProjectMessageCount `json:"projects"` TotalCount int64 `json:"total_message_count"` AverageDailyMessages float64 `json:"average_daily_messages"` }