project

package
v0.0.0-...-c101990 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PROJECT_COLLECTION = "project"

Variables

This section is empty.

Functions

This section is empty.

Types

type ProjectHandler

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

func NewProjectHandler

func NewProjectHandler(store types.ProjectStore, sbomStore types.SbomStore, componentStore types.ComponentStore) *ProjectHandler

func (*ProjectHandler) CreateProject

func (p *ProjectHandler) CreateProject(c *gin.Context)

func (*ProjectHandler) DeleteProjectById

func (s *ProjectHandler) DeleteProjectById(c *gin.Context)

curl http://localhost:8080/api/v1/project/{project_id}

func (*ProjectHandler) GetProjectById

func (p *ProjectHandler) GetProjectById(c *gin.Context)

curl http://localhost:8080/api/v1/project/{project_id}

func (*ProjectHandler) GetProjects

func (p *ProjectHandler) GetProjects(c *gin.Context)

curl http://localhost:8080/api/v1/project

func (*ProjectHandler) RegisterRoutes

func (p *ProjectHandler) RegisterRoutes(r *gin.Engine)

func (*ProjectHandler) UpdateProjectById

func (p *ProjectHandler) UpdateProjectById(c *gin.Context)

type ProjectStore

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

func NewProjectStore

func NewProjectStore(db *mongo.Database) *ProjectStore

func (*ProjectStore) AddProject

func (p *ProjectStore) AddProject(project types.Project) (string, error)

func (*ProjectStore) DeleteById

func (p *ProjectStore) DeleteById(idParam string, duration int) (int64, error)

func (*ProjectStore) DeleteByIds

func (p *ProjectStore) DeleteByIds(idParams []string, duration int) (int64, error)

func (*ProjectStore) GetByName

func (p *ProjectStore) GetByName(name string, duration int) ([]types.Project, error)

func (*ProjectStore) GetProjectById

func (p *ProjectStore) GetProjectById(idParam string, duration int) ([]types.Project, error)

Handler for getting paginated items

func (*ProjectStore) GetTotalCount

func (p *ProjectStore) GetTotalCount(filter interface{}) (int64, error)

func (*ProjectStore) GetUsingFilter

func (p *ProjectStore) GetUsingFilter(filter interface{}, page, limit, duration int) ([]types.Project, error)

func (*ProjectStore) UpdateById

func (p *ProjectStore) UpdateById(payload types.Project, duration int) error

validates object id and updates object as per payload

func (*ProjectStore) ValidateIds

func (c *ProjectStore) ValidateIds(ids []string) error

Jump to

Keyboard shortcuts

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