fabric8-wit: github.com/fabric8-services/fabric8-wit/spacetemplate Index | Files | Directories

package spacetemplate

import "github.com/fabric8-services/fabric8-wit/spacetemplate"

Package spacetemplate contains the repository for handling space templates.

Index

Package Files

doc.go repository.go template.go

Variables

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!!!

type GormRepository Uses

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

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

func (*GormRepository) CheckExists Uses

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 Uses

func (r *GormRepository) Create(ctx context.Context, s SpaceTemplate) (*SpaceTemplate, error)

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 Uses

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

List returns an array with all space templates in it

func (*GormRepository) Load Uses

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

Load returns a single space template by a given ID

type Repository Uses

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 Uses

func NewRepository(db *gorm.DB) Repository

NewRepository creates a new space template repository

type SpaceTemplate Uses

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 Uses

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

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

func (SpaceTemplate) GetETagData Uses

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

GetETagData returns the field values to use to generate the ETag

func (SpaceTemplate) GetLastModified Uses

func (s SpaceTemplate) GetLastModified() time.Time

GetLastModified returns the last modification time

func (SpaceTemplate) TableName Uses

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 Uses

func (s *SpaceTemplate) Validate() error

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

Directories

PathSynopsis
importerPackage importer provides functions to help import a space template YAML definition into the system.

Package spacetemplate imports 10 packages (graph) and is imported by 18 packages. Updated 2018-05-22. Refresh now. Tools for package owners.