workitem

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package workitem contains the code that allows to manage work items, work item types.

Index

Constants

View Source
const (
	SystemRemoteItemID        = "system.remote_item_id"
	SystemTitle               = "system.title"
	SystemDescription         = "system.description"
	SystemDescriptionMarkup   = "system.description.markup"
	SystemDescriptionRendered = "system.description.rendered"
	SystemState               = "system.state"
	SystemAssignees           = "system.assignees"
	SystemCreator             = "system.creator"
	SystemCreatedAt           = "system.created_at"
	SystemUpdatedAt           = "system.updated_at"
	SystemOrder               = "system.order"
	SystemIteration           = "system.iteration"
	SystemArea                = "system.area"
	SystemCodebase            = "system.codebase"

	SystemStateOpen       = "open"
	SystemStateNew        = "new"
	SystemStateInProgress = "in progress"
	SystemStateResolved   = "resolved"
	SystemStateClosed     = "closed"
)

String constants for the local work item types.

Variables

View Source
var (
	// base item type with common fields for planner item types like userstory, experience, bug, feature, etc.
	SystemPlannerItem      = uuid.FromStringOrNil("86af5178-9b41-469b-9096-57e5155c3f31") // "planneritem"
	SystemTask             = uuid.FromStringOrNil("bbf35418-04b6-426c-a60b-7f80beb0b624") // "task"
	SystemValueProposition = uuid.FromStringOrNil("3194ab60-855b-4155-9005-9dce4a05f1eb") // "valueproposition"
	SystemFundamental      = uuid.FromStringOrNil("ee7ca005-f81d-4eea-9b9b-1965df0988d0") // "fundamental"
	SystemExperience       = uuid.FromStringOrNil("b9a71831-c803-4f66-8774-4193fffd1311") // "experience"
	SystemFeature          = uuid.FromStringOrNil("0a24d3c2-e0a6-4686-8051-ec0ea1915a28") // "feature"
	SystemScenario         = uuid.FromStringOrNil("71171e90-6d35-498f-a6a7-2083b5267c18") // "scenario"
	SystemBug              = uuid.FromStringOrNil("26787039-b68f-4e28-8814-c2f93be1ef4e") // "bug"
	SystemPapercuts        = uuid.FromStringOrNil("6d603ab4-7c5e-4c5f-bba8-a3ba9d370985") // "papercuts"
)

Never ever change these UUIDs!!!

Functions

func ClearGlobalWorkItemTypeCache

func ClearGlobalWorkItemTypeCache()

ClearGlobalWorkItemTypeCache removes all work items from the global cache

func Compile

func Compile(where criteria.Expression) (whereClause string, parameters []interface{}, err []error)

Compile takes an expression and compiles it to a where clause for use with gorm.DB.Where() Returns the number of expected parameters for the query and a slice of errors if something goes wrong

func ConvertList

func ConvertList(converter Converter, componentType SimpleType, value interface{}) ([]interface{}, error)

func GetTypePathSeparator

func GetTypePathSeparator() string

GetTypePathSeparator returns the work item type's path separator "."

func LtreeSafeID

func LtreeSafeID(witID uuid.UUID) string

LtreeSafeID returns the ID of the work item type in an postgres ltree safe manner The returned string can be used as an ltree node.

func ParseWorkItemIDToUint64

func ParseWorkItemIDToUint64(wiIDStr string) (uint64, error)

ParseWorkItemIDToUint64 does what it says

Types

type Converter

type Converter func(FieldType, interface{}) (interface{}, error)

type DirectionType

type DirectionType string
const (
	DirectionAbove  DirectionType = "above"
	DirectionBelow  DirectionType = "below"
	DirectionTop    DirectionType = "top"
	DirectionBottom DirectionType = "bottom"
)

type EnumType

type EnumType struct {
	SimpleType
	BaseType SimpleType
	Values   []interface{}
}

func (EnumType) ConvertFromModel

func (fieldType EnumType) ConvertFromModel(value interface{}) (interface{}, error)

func (EnumType) ConvertToModel

func (fieldType EnumType) ConvertToModel(value interface{}) (interface{}, error)

func (EnumType) Equal

func (t EnumType) Equal(u convert.Equaler) bool

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

type FieldDefinition

type FieldDefinition struct {
	Required    bool
	Label       string
	Description string
	Type        FieldType
}

FieldDefinition describes type & other restrictions of a field

func (FieldDefinition) ConvertFromModel

func (f FieldDefinition) ConvertFromModel(name string, value interface{}) (interface{}, error)

ConvertFromModel converts a field value for use in the REST API layer

func (FieldDefinition) ConvertToModel

func (f FieldDefinition) ConvertToModel(name string, value interface{}) (interface{}, error)

ConvertToModel converts a field value for use in the persistence layer

func (FieldDefinition) Equal

func (f FieldDefinition) Equal(u convert.Equaler) bool

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

func (*FieldDefinition) UnmarshalJSON

func (f *FieldDefinition) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements encoding/json.Unmarshaler

type FieldDefinitions

type FieldDefinitions map[string]FieldDefinition

func (*FieldDefinitions) Scan

func (j *FieldDefinitions) Scan(src interface{}) error

func (FieldDefinitions) Value

func (j FieldDefinitions) Value() (driver.Value, error)

type FieldType

type FieldType interface {
	GetKind() Kind
	// ConvertToModel converts a field value for use in the persistence layer
	ConvertToModel(value interface{}) (interface{}, error)
	// ConvertFromModel converts a field value for use in the REST API layer
	ConvertFromModel(value interface{}) (interface{}, error)
	// Implement the Equaler interface
	Equal(u convert.Equaler) bool
}

FieldType describes the possible values of a FieldDefinition

type Fields

type Fields map[string]interface{}

func (Fields) Equal

func (f Fields) Equal(u convert.Equaler) bool

Equal returns true if two Fields objects are equal; otherwise false is returned. TODO: (kwk) think about a better comparison for Fields map.

func (*Fields) Scan

func (j *Fields) Scan(src interface{}) error

func (Fields) Value

func (j Fields) Value() (driver.Value, error)

type GormRevisionRepository

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

GormRevisionRepository implements RevisionRepository using gorm

func NewRevisionRepository

func NewRevisionRepository(db *gorm.DB) *GormRevisionRepository

NewRevisionRepository creates a GormRevisionRepository

func (*GormRevisionRepository) Create

func (r *GormRevisionRepository) Create(ctx context.Context, modifierID uuid.UUID, revisionType RevisionType, workitem WorkItemStorage) error

Create stores a new revision for the given work item.

func (*GormRevisionRepository) List

func (r *GormRevisionRepository) List(ctx context.Context, workitemID string) ([]Revision, error)

List retrieves all revisions for a given work item

type GormWorkItemRepository

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

GormWorkItemRepository implements WorkItemRepository using gorm

func NewWorkItemRepository

func NewWorkItemRepository(db *gorm.DB) *GormWorkItemRepository

NewWorkItemRepository creates a GormWorkItemRepository

func (*GormWorkItemRepository) CalculateOrder

func (r *GormWorkItemRepository) CalculateOrder(above, below *float64) float64

Calculates the order of the reorder workitem

func (*GormWorkItemRepository) Count

func (r *GormWorkItemRepository) Count(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (int, error)

Counts returns the amount of work item that satisfy the given criteria.Expression

func (*GormWorkItemRepository) Create

func (r *GormWorkItemRepository) Create(ctx context.Context, spaceID uuid.UUID, typeID uuid.UUID, fields map[string]interface{}, creatorID uuid.UUID) (*WorkItem, error)

Create creates a new work item in the repository returns BadParameterError, ConversionError or InternalError

func (*GormWorkItemRepository) Delete

func (r *GormWorkItemRepository) Delete(ctx context.Context, spaceID uuid.UUID, workitemID string, suppressorID uuid.UUID) error

Delete deletes the work item with the given id returns NotFoundError or InternalError

func (*GormWorkItemRepository) Fetch

func (r *GormWorkItemRepository) Fetch(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (*WorkItem, error)

Fetch fetches the (first) work item matching by the given criteria.Expression.

func (*GormWorkItemRepository) FindFirstItem

func (r *GormWorkItemRepository) FindFirstItem(id string) (*float64, error)

FindFirstItem returns the order of the target workitem

func (*GormWorkItemRepository) FindSecondItem

func (r *GormWorkItemRepository) FindSecondItem(order *float64, secondItemDirection DirectionType) (*string, *float64, error)

Reordering a workitem requires order of two closest workitems: above and below. FindSecondItem returns the order of the second workitem required to reorder. If direction == "above", then

	FindFirstItem returns the value above which reorder item has to be placed
     FindSecondItem returns the value below which reorder item has to be placed

If direction == "below", then

	FindFirstItem returns the value below which reorder item has to be placed
     FindSecondItem returns the value above which reorder item has to be placed

func (*GormWorkItemRepository) GetCountsForIteration

func (r *GormWorkItemRepository) GetCountsForIteration(ctx context.Context, iterationID uuid.UUID) (map[string]WICountsPerIteration, error)

GetCountsForIteration returns Closed and Total counts of WI for given iteration It executes SELECT count(*) as Total, count( case fields->>'system.state' when 'closed' then '1' else null end ) as Closed FROM "work_items" where fields@> concat('{"system.iteration": "%s"}')::jsonb and work_items.deleted_at is null

func (*GormWorkItemRepository) GetCountsPerIteration

func (r *GormWorkItemRepository) GetCountsPerIteration(ctx context.Context, spaceID uuid.UUID) (map[string]WICountsPerIteration, error)

GetCountsPerIteration fetches WI count from DB and returns a map of iterationID->WICountsPerIteration This function executes following query to fetch 'closed' and 'total' counts of the WI for each iteration in given spaceID

SELECT iterations.id as IterationId, count(*) as Total,
	count( case fields->>'system.state' when 'closed' then '1' else null end ) as Closed
	FROM "work_items" left join iterations
	on fields@> concat('{"system.iteration": "', iterations.id, '"}')::jsonb
	WHERE (iterations.space_id = '33406de1-25f1-4969-bcec-88f29d0a7de3'
	and work_items.deleted_at IS NULL) GROUP BY IterationId

func (*GormWorkItemRepository) List

func (r *GormWorkItemRepository) List(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression, parentExists *bool, start *int, limit *int) ([]WorkItem, uint64, error)

List returns work item selected by the given criteria.Expression, starting with start (zero-based) and returning at most limit items

func (*GormWorkItemRepository) Load

func (r *GormWorkItemRepository) Load(ctx context.Context, spaceID uuid.UUID, workitemID string) (*WorkItem, error)

Load returns the work item for the given spaceID and item id returns NotFoundError, ConversionError or InternalError

func (*GormWorkItemRepository) LoadBottomWorkitem

func (r *GormWorkItemRepository) LoadBottomWorkitem(ctx context.Context) (*WorkItem, error)

LoadBottomWorkitem returns bottom work item of the list. Bottom most workitem has the lowest order. returns NotFoundError, ConversionError or InternalError

func (*GormWorkItemRepository) LoadByID

func (r *GormWorkItemRepository) LoadByID(ctx context.Context, ID string) (*WorkItem, error)

Load returns the work item for the given id returns NotFoundError, ConversionError or InternalError

func (*GormWorkItemRepository) LoadFromDB

func (r *GormWorkItemRepository) LoadFromDB(ctx context.Context, workitemID string) (*WorkItemStorage, error)

LoadFromDB returns the work item with the given ID in model representation.

func (*GormWorkItemRepository) LoadHighestOrder

func (r *GormWorkItemRepository) LoadHighestOrder() (float64, error)

LoadHighestOrder returns the highest order

func (*GormWorkItemRepository) LoadTopWorkitem

func (r *GormWorkItemRepository) LoadTopWorkitem(ctx context.Context) (*WorkItem, error)

LoadTopWorkitem returns top most work item of the list. Top most workitem has the Highest order. returns NotFoundError, ConversionError or InternalError

func (*GormWorkItemRepository) Reorder

func (r *GormWorkItemRepository) Reorder(ctx context.Context, direction DirectionType, targetID *string, wi WorkItem, modifierID uuid.UUID) (*WorkItem, error)

Reorder places the to-be-reordered workitem above the input workitem. The order of workitems are spaced by a factor of 1000. The new order of workitem := (order of previousitem + order of nextitem)/2 Version must be the same as the one int the stored version

func (*GormWorkItemRepository) Save

func (r *GormWorkItemRepository) Save(ctx context.Context, spaceID uuid.UUID, updatedWorkItem WorkItem, modifierID uuid.UUID) (*WorkItem, error)

Save updates the given work item in storage. Version must be the same as the one int the stored version returns NotFoundError, VersionConflictError, ConversionError or InternalError

type GormWorkItemTypeRepository

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

GormWorkItemTypeRepository implements WorkItemTypeRepository using gorm

func NewWorkItemTypeRepository

func NewWorkItemTypeRepository(db *gorm.DB) *GormWorkItemTypeRepository

NewWorkItemTypeRepository creates a wi type repository based on gorm

func (*GormWorkItemTypeRepository) Create

func (r *GormWorkItemTypeRepository) Create(ctx context.Context, spaceID uuid.UUID, id *uuid.UUID, extendedTypeID *uuid.UUID, name string, description *string, icon string, fields map[string]FieldDefinition) (*WorkItemType, error)

Create creates a new work item in the repository returns BadParameterError, ConversionError or InternalError

func (*GormWorkItemTypeRepository) List

func (r *GormWorkItemTypeRepository) List(ctx context.Context, spaceID uuid.UUID, start *int, limit *int) ([]WorkItemType, error)

List returns work item types selected by the given criteria.Expression, starting with start (zero-based) and returning at most "limit" item types.

func (*GormWorkItemTypeRepository) ListPlannerItems

func (r *GormWorkItemTypeRepository) ListPlannerItems(ctx context.Context, spaceID uuid.UUID) ([]WorkItemType, error)

List returns work item types that derives from PlannerItem type

func (*GormWorkItemTypeRepository) Load

Load returns the work item for the given spaceID and id returns NotFoundError, InternalError

func (*GormWorkItemTypeRepository) LoadByID

LoadByID returns the work item for the given id returns NotFoundError, InternalError

func (*GormWorkItemTypeRepository) LoadTypeFromDB

func (r *GormWorkItemTypeRepository) LoadTypeFromDB(ctx context.Context, id uuid.UUID) (*WorkItemType, error)

LoadTypeFromDB return work item type for the given id

type Kind

type Kind string

Kind is the kind of field type

const (
	KindString            Kind = "string"
	KindInteger           Kind = "integer"
	KindFloat             Kind = "float"
	KindInstant           Kind = "instant"
	KindDuration          Kind = "duration"
	KindURL               Kind = "url"
	KindIteration         Kind = "iteration"
	KindWorkitemReference Kind = "workitem"
	KindUser              Kind = "user"
	KindEnum              Kind = "enum"
	KindList              Kind = "list"
	KindMarkup            Kind = "markup"
	KindArea              Kind = "area"
	KindCodebase          Kind = "codebase"
)

constants for describing possible field types

func ConvertAnyToKind

func ConvertAnyToKind(any interface{}) (*Kind, error)

func ConvertStringToKind

func ConvertStringToKind(k string) (*Kind, error)

func (Kind) IsSimpleType

func (k Kind) IsSimpleType() bool

IsSimpleType returns 'true' if the kind is simple, i.e., not a list nor an enum

type ListType

type ListType struct {
	SimpleType
	ComponentType SimpleType
}

ListType describes a list of SimpleType values

func (ListType) ConvertFromModel

func (fieldType ListType) ConvertFromModel(value interface{}) (interface{}, error)

ConvertFromModel implements the FieldType interface

func (ListType) ConvertToModel

func (fieldType ListType) ConvertToModel(value interface{}) (interface{}, error)

ConvertToModel implements the FieldType interface

func (ListType) Equal

func (t ListType) Equal(u convert.Equaler) bool

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

type Revision

type Revision struct {
	ID uuid.UUID `gorm:"primary_key"`
	// the timestamp of the modification
	Time time.Time `gorm:"column:revision_time"`
	// the type of modification
	Type RevisionType `gorm:"column:revision_type"`
	// the identity of author of the workitem modification
	ModifierIdentity uuid.UUID `sql:"type:uuid" gorm:"column:modifier_id"`
	// the id of the work item that changed
	WorkItemID uint64 `gorm:"column:work_item_id"`
	// Id of the type of this work item
	WorkItemTypeID uuid.UUID `gorm:"column:work_item_type_id"`
	// Version of the workitem that was modified
	WorkItemVersion int `gorm:"column:work_item_version"`
	// the field values (or empty when the work item was deleted)
	WorkItemFields Fields `gorm:"column:work_item_fields" sql:"type:jsonb"`
}

Revision represents a version of a work item

func (Revision) TableName

func (w Revision) TableName() string

TableName implements gorm.tabler

type RevisionRepository

type RevisionRepository interface {
	// Create stores a new revision for the given work item.
	Create(ctx context.Context, modifierID uuid.UUID, revisionType RevisionType, workitem WorkItemStorage) error
	// List retrieves all revisions for a given work item
	List(ctx context.Context, workitemID string) ([]Revision, error)
}

RevisionRepository encapsulates storage & retrieval of historical versions of work items

type RevisionType

type RevisionType int

RevisionType defines the type of revision for a work item

const (

	// RevisionTypeCreate a work item creation
	RevisionTypeCreate RevisionType // 1
	// RevisionTypeDelete a work item deletion
	RevisionTypeDelete // 2

	// RevisionTypeUpdate a work item update
	RevisionTypeUpdate // 4
)

type SimpleType

type SimpleType struct {
	Kind Kind
}

SimpleType is an unstructured FieldType

func (SimpleType) ConvertFromModel

func (fieldType SimpleType) ConvertFromModel(value interface{}) (interface{}, error)

ConvertFromModel implements the FieldType interface

func (SimpleType) ConvertToModel

func (fieldType SimpleType) ConvertToModel(value interface{}) (interface{}, error)

ConvertToModel implements the FieldType interface

func (SimpleType) Equal

func (t SimpleType) Equal(u convert.Equaler) bool

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

func (SimpleType) GetKind

func (t SimpleType) GetKind() Kind

GetKind implements FieldType

type WICountsPerIteration

type WICountsPerIteration struct {
	IterationID string `gorm:"column:iterationid"`
	Total       int
	Closed      int
}

WICountsPerIteration counting work item states by iteration

type WorkItem

type WorkItem struct {
	// unique id per installation
	ID string
	// ID of the type of this work item
	Type uuid.UUID
	// Version for optimistic concurrency control
	Version int
	// ID of the space to which this work item belongs
	SpaceID uuid.UUID
	// The field values, according to the field type
	Fields map[string]interface{}
}

WorkItem the model structure for the work item.

func ConvertWorkItemStorageToModel

func ConvertWorkItemStorageToModel(wiType *WorkItemType, wi *WorkItemStorage) (*WorkItem, error)

ConvertWorkItemStorageToModel convert work item model to app WI

func (WorkItem) GetETagData

func (wi WorkItem) GetETagData() []interface{}

GetETagData returns the field values to use to generate the ETag

func (WorkItem) GetLastModified

func (wi WorkItem) GetLastModified() time.Time

GetLastModified returns the last modification time

type WorkItemRepository

type WorkItemRepository interface {
	LoadByID(ctx context.Context, ID string) (*WorkItem, error)
	Load(ctx context.Context, spaceID uuid.UUID, ID string) (*WorkItem, error)
	Save(ctx context.Context, spaceID uuid.UUID, wi WorkItem, modifierID uuid.UUID) (*WorkItem, error)
	Reorder(ctx context.Context, direction DirectionType, targetID *string, wi WorkItem, modifierID uuid.UUID) (*WorkItem, error)
	Delete(ctx context.Context, spaceID uuid.UUID, ID string, suppressorID uuid.UUID) error
	Create(ctx context.Context, spaceID uuid.UUID, typeID uuid.UUID, fields map[string]interface{}, creatorID uuid.UUID) (*WorkItem, error)
	List(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression, parentExists *bool, start *int, length *int) ([]WorkItem, uint64, error)
	Fetch(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (*WorkItem, error)
	GetCountsPerIteration(ctx context.Context, spaceID uuid.UUID) (map[string]WICountsPerIteration, error)
	GetCountsForIteration(ctx context.Context, iterationID uuid.UUID) (map[string]WICountsPerIteration, error)
	Count(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression) (int, error)
}

WorkItemRepository encapsulates storage & retrieval of work items

type WorkItemStorage

type WorkItemStorage struct {
	gormsupport.Lifecycle
	ID uint64 `gorm:"primary_key"`
	// Id of the type of this work item
	Type uuid.UUID `sql:"type:uuid"`
	// Version for optimistic concurrency control
	Version int
	// the field values
	Fields Fields `sql:"type:jsonb"`
	// the position of workitem
	ExecutionOrder float64
	// Reference to one Space
	SpaceID uuid.UUID `sql:"type:uuid"`
}

WorkItemStorage represents a work item as it is stored in the database

func (WorkItemStorage) Equal

func (wi WorkItemStorage) Equal(u convert.Equaler) bool

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

func (WorkItemStorage) TableName

func (w WorkItemStorage) TableName() string

TableName implements gorm.tabler

type WorkItemType

type WorkItemType struct {
	gormsupport.Lifecycle
	// ID
	ID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key"`
	// Name is a human readable name of this work item type
	Name string
	// Description is an optional description of the work item type
	Description *string
	// The CSS icon class to render an icon for the WIT
	Icon string
	// Version for optimistic concurrency control
	Version int
	// the IDs of the parents, separated with a dot (".") separator
	Path string
	// definitions of the fields this work item type supports
	Fields FieldDefinitions `sql:"type:jsonb"`
	// Reference to one Space
	SpaceID uuid.UUID `sql:"type:uuid"`
}

WorkItemType represents a work item type as it is stored in the db

func (WorkItemType) ConvertWorkItemStorageToModel

func (wit WorkItemType) ConvertWorkItemStorageToModel(workItem WorkItemStorage) (*WorkItem, error)

ConvertWorkItemStorageToModel converts a workItem from the storage/persistence layer into a workItem of the model domain layer

func (WorkItemType) Equal

func (wit WorkItemType) Equal(u convert.Equaler) bool

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

func (WorkItemType) GetETagData

func (wit WorkItemType) GetETagData() []interface{}

GetETagData returns the field values to use to generate the ETag

func (WorkItemType) GetLastModified

func (wit WorkItemType) GetLastModified() time.Time

GetLastModified returns the last modification time

func (WorkItemType) IsTypeOrSubtypeOf

func (wit WorkItemType) IsTypeOrSubtypeOf(typeID uuid.UUID) bool

IsTypeOrSubtypeOf returns true if the work item type with the given type ID, is of the same type as the current WIT or of it is a subtype; otherwise false is returned.

func (WorkItemType) LtreeSafeID

func (wit WorkItemType) LtreeSafeID() string

LtreeSafeID returns the ID of the work item type in an postgres ltree safe manner. The returned string can be used as an ltree node.

func (WorkItemType) TableName

func (wit WorkItemType) TableName() string

TableName implements gorm.tabler

type WorkItemTypeCache

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

WorkItemTypeCache represents WorkItemType cache

func NewWorkItemTypeCache

func NewWorkItemTypeCache() *WorkItemTypeCache

NewWorkItemTypeCache constructs WorkItemTypeCache

func (*WorkItemTypeCache) Clear

func (c *WorkItemTypeCache) Clear()

Clear clears the cache

func (*WorkItemTypeCache) Get

Get returns WorkItemType by ID. The second value (ok) is a bool that is true if the WorkItemType exists in the cache, and false if not.

func (*WorkItemTypeCache) Put

func (c *WorkItemTypeCache) Put(wit WorkItemType)

Put puts a work item type to the cache

type WorkItemTypeRepository

type WorkItemTypeRepository interface {
	Load(ctx context.Context, spaceID uuid.UUID, id uuid.UUID) (*WorkItemType, error)
	Create(ctx context.Context, spaceID uuid.UUID, id *uuid.UUID, extendedTypeID *uuid.UUID, name string, description *string, icon string, fields map[string]FieldDefinition) (*WorkItemType, error)
	List(ctx context.Context, spaceID uuid.UUID, start *int, length *int) ([]WorkItemType, error)
	ListPlannerItems(ctx context.Context, spaceID uuid.UUID) ([]WorkItemType, error)
}

WorkItemTypeRepository encapsulates storage & retrieval of work item types

Directories

Path Synopsis
Package link contains the code that provides all the required operations to manage work item link, work item link types and work item link categories.
Package link contains the code that provides all the required operations to manage work item link, work item link types and work item link categories.

Jump to

Keyboard shortcuts

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