Documentation ¶
Overview ¶
Package space provides all the required functions to manage the definition of spaces.
Index ¶
- Variables
- type GormRepository
- func (r *GormRepository) CheckExists(ctx context.Context, id uuid.UUID) error
- func (r *GormRepository) Create(ctx context.Context, space *Space) (*Space, error)
- func (r *GormRepository) Delete(ctx context.Context, ID uuid.UUID) error
- func (r *GormRepository) List(ctx context.Context, start *int, limit *int) ([]Space, int, error)
- func (r *GormRepository) Load(ctx context.Context, ID uuid.UUID) (*Space, error)
- func (r *GormRepository) LoadByOwner(ctx context.Context, userID *uuid.UUID, start *int, limit *int) ([]Space, int, error)
- func (r *GormRepository) LoadByOwnerAndName(ctx context.Context, userID *uuid.UUID, spaceName *string) (*Space, error)
- func (r *GormRepository) LoadMany(ctx context.Context, IDs []uuid.UUID) ([]Space, error)
- func (r *GormRepository) Save(ctx context.Context, p *Space) (*Space, error)
- func (r *GormRepository) Search(ctx context.Context, q *string, start *int, limit *int) ([]Space, int, error)
- type Repository
- type Space
Constants ¶
This section is empty.
Variables ¶
var ( SystemSpace = uuid.FromStringOrNil("2e0698d8-753e-4cef-bb7c-f027634824a2") SpaceType = "spaces" )
Functions ¶
This section is empty.
Types ¶
type GormRepository ¶
type GormRepository struct {
// contains filtered or unexported fields
}
GormRepository implements SpaceRepository using gorm
func NewRepository ¶
func NewRepository(db *gorm.DB) *GormRepository
NewRepository creates a new space repo
func (*GormRepository) CheckExists ¶
CheckExists returns nil if the given ID exists otherwise returns an error
func (*GormRepository) Create ¶
Create creates a new Space in the db returns BadParameterError or InternalError
func (*GormRepository) Delete ¶
Delete deletes the space with the given id returns NotFoundError or InternalError
func (*GormRepository) List ¶
List returns work item selected by the given criteria.Expression, starting with start (zero-based) and returning at most limit items
func (*GormRepository) Load ¶
Load returns the space for the given id returns NotFoundError or InternalError
func (*GormRepository) LoadByOwner ¶
func (*GormRepository) LoadByOwnerAndName ¶
func (*GormRepository) LoadMany ¶
LoadMany returns the spaces for the given IDs returns NotFoundError or InternalError
type Repository ¶
type Repository interface { repository.Exister Create(ctx context.Context, space *Space) (*Space, error) Save(ctx context.Context, space *Space) (*Space, error) Load(ctx context.Context, ID uuid.UUID) (*Space, error) LoadMany(ctx context.Context, IDs []uuid.UUID) ([]Space, error) Delete(ctx context.Context, ID uuid.UUID) error LoadByOwner(ctx context.Context, userID *uuid.UUID, start *int, length *int) ([]Space, int, error) LoadByOwnerAndName(ctx context.Context, userID *uuid.UUID, spaceName *string) (*Space, error) List(ctx context.Context, start *int, length *int) ([]Space, int, error) Search(ctx context.Context, q *string, start *int, length *int) ([]Space, int, error) }
Repository encapsulate storage & retrieval of spaces
type Space ¶
type Space struct { gormsupport.Lifecycle ID uuid.UUID Version int Name string Description string OwnerID uuid.UUID `sql:"type:uuid"` // Belongs To Identity SpaceTemplateID uuid.UUID `sql:"type:uuid"` }
Space represents a Space on the domain and db layer
func (Space) Equal ¶
Equal returns true if two Space objects are equal; otherwise false is returned.
func (Space) GetETagData ¶
func (p Space) GetETagData() []interface{}
GetETagData returns the field values to use to generate the ETag
func (Space) GetLastModified ¶
GetLastModified returns the last modification time