spacetemplate

package
v0.0.0-...-ef83997 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package spacetemplate contains the repository for handling space templates.

Index

Constants

This section is empty.

Variables

View Source
var (
	// pre-defined space templates
	SystemLegacyTemplateID        = uuid.FromStringOrNil("929c963a-174c-4c37-b487-272067e88bd4")
	SystemBaseTemplateID          = uuid.FromStringOrNil("1f48b7bf-bc51-4823-8101-9f10039035ba")
	SystemScrumTemplateID         = uuid.FromStringOrNil("cfff59dc-007a-4fa5-acf7-376d5345aef2")
	SystemIssueTrackingTemplateID = uuid.FromStringOrNil("f4a24db4-9376-4777-832b-852e0ce02fd7")
)

Never ever change these UUIDs!!!

Functions

This section is empty.

Types

type GormRepository

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

GormRepository is the implementation of the repository interface for space templates.

func (*GormRepository) CheckExists

func (r *GormRepository) CheckExists(ctx context.Context, id uuid.UUID) error

CheckExists returns nil if a spacetemplate exists with a given ID

func (*GormRepository) Create

Create creates a new space template and all the artifacts (e.g. work item types, work item link types) in the system.

func (*GormRepository) List

func (r *GormRepository) List(ctx context.Context) ([]SpaceTemplate, error)

List returns an array with all space templates in it

func (*GormRepository) Load

func (r *GormRepository) Load(ctx context.Context, spaceTemplateID uuid.UUID) (*SpaceTemplate, error)

Load returns a single space template by a given ID

type Repository

type Repository interface {
	repository.Exister
	// Create creates a new space template and all the artifacts (e.g. work item
	// types, work item link types) in the system.
	Create(ctx context.Context, template SpaceTemplate) (*SpaceTemplate, error)
	// List returns an array with all space templates in it
	List(ctx context.Context) ([]SpaceTemplate, error)
	// Load returns a single space template by a given ID
	Load(ctx context.Context, templateID uuid.UUID) (*SpaceTemplate, error)
}

Repository describes interactions with space templates

func NewRepository

func NewRepository(db *gorm.DB) Repository

NewRepository creates a new space template repository

type SpaceTemplate

type SpaceTemplate struct {
	gormsupport.Lifecycle `json:"lifecycle"`
	ID                    uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key" json:"id"`
	Version               int       `json:"version"`
	Name                  string    `json:"name"`
	Description           *string   `json:"description,omitempty"`
	CanConstruct          bool      `gorm:"can_construct" json:"can_construct"`
}

A SpaceTemplate defines is what is stored in the database. See the ImportHelper to learn more about how we import space templates using YAML.

func (SpaceTemplate) Equal

func (s SpaceTemplate) Equal(u convert.Equaler) bool

Equal returns true if two SpaceTemplate objects are equal; otherwise false is returned.

func (SpaceTemplate) GetETagData

func (s SpaceTemplate) GetETagData() []interface{}

GetETagData returns the field values to use to generate the ETag

func (SpaceTemplate) GetLastModified

func (s SpaceTemplate) GetLastModified() time.Time

GetLastModified returns the last modification time

func (SpaceTemplate) TableName

func (s SpaceTemplate) TableName() string

TableName overrides the table name settings in Gorm to force a specific table name in the database.

func (*SpaceTemplate) Validate

func (s *SpaceTemplate) Validate() error

Validate ensures that all inner-document references of the given space template are fine.

Directories

Path Synopsis
Package importer provides functions to help import a space template YAML definition into the system.
Package importer provides functions to help import a space template YAML definition into the system.

Jump to

Keyboard shortcuts

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