project

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProjectDoesNotExist = errors.New("project does not exist")
)

errors

Functions

func Configure

func Configure(api *operations.ClaAPI, service service)

Configure establishes the middleware handlers for the project service

func NewRepository

func NewRepository(db *sqlx.DB) repository

NewRepository creates a new instance of the repository service

func NewService

func NewService(projectRepo Repository) service

NewService returns an instance of the project service

Types

type DynamoRepository added in v1.0.4

type DynamoRepository interface {
	GetProject(projectID string) (*Project, error)
}

DynamoRepository defines functions of Project repository

func NewDynamoRepository added in v1.0.4

func NewDynamoRepository(awsSession *session.Session, stage string) DynamoRepository

NewDynamoRepository creates instance of project repository

type Project added in v1.0.4

type Project struct {
	DateCreated                      string   `dynamodbav:"date_created"`
	DateModified                     string   `dynamodbav:"date_modified"`
	ProjectExternalID                string   `dynamodbav:"project_external_id"`
	ProjectID                        string   `dynamodbav:"project_id"`
	ProjectName                      string   `dynamodbav:"project_name"`
	Version                          string   `dynamodbav:"version"`
	ProjectCclaEnabled               bool     `dynamodbav:"project_ccla_enabled"`
	ProjectCclaRequiresIclaSignature bool     `dynamodbav:"project_ccla_requires_icla_signature"`
	ProjectIclaEnabled               bool     `dynamodbav:"project_icla_enabled"`
	ProjectACL                       []string `dynamodbav:"project_acl"`
}

Project data model

type Repository

type Repository interface {
	GetProjectIDsForUser(ctx context.Context, userID string) ([]string, error)
}

Repository defines the interfaces for the project service

type Service

type Service interface {
	GetProjects(ctx context.Context) ([]models.Project, error)
	GetProjectByID(ctx context.Context, projectID string) (models.Project, error)
}

Service interface defines the project service methods/functions

Jump to

Keyboard shortcuts

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