sql

package
v3.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, m map[string]any) (projects.Catalogue, error)

Types

type Config

type Config struct {
	config.Database `mapstructure:",squash"`
	// CacheTTL (seconds) determines how long the list of projects will be stored in a cache
	// before a new database query is executed. The default, 0, corresponds to 60 seconds.
	CacheTTL int `mapstructure:"cache_ttl"`
}

Config is the configuration to use for the sql driver implementing the projects.Catalogue interface.

func (*Config) ApplyDefaults added in v3.4.0

func (c *Config) ApplyDefaults()

type Project

type Project struct {
	gorm.Model
	SpaceID   string `gorm:"size:255;uniqueIndex:i_space_id"`
	StorageID string `gorm:"size:255"`
	Path      string
	Name      string `gorm:"size:255;uniqueIndex:i_name_archived_at"`
	// Owner of the project
	Owner string `gorm:"size:255"`
	// Readers e-group ID
	Readers string
	// Writers e-group ID
	Writers string
	// Admins e-group ID
	Admins string
	// Called description in libregraph API
	// Called subtitle in front-end
	Description string
	// Path of readme.md
	ReadmePath string
	// Path of the thumbnail file
	ThumbnailPath string
	// Set if the project is archived, i.e. not available to users in this state
	ArchivedAt datatypes.NullTime `gorm:"uniqueIndex:i_name_archived_at"`
	// Comma-seperated list of arbitrary capabilities of the project
	Capabilities string

	// Description of the use-case that was passed in the creation ticket
	UserProvidedDescription string
	// Service acount linked to the project
	ServiceAccount string
	// Comments about the project, for second / third level support
	Comments string
	// Reference to the ticket that requested the project
	SnowTicket string
	// ID of the Backup Job
	BackupJobId string
	// Initially requested capacity
	InitialCapacityBytes uint64
}

Project represents a project in the DB.

type ProjectsManager added in v3.2.0

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

func (*ProjectsManager) CreateStorageSpace added in v3.2.0

func (*ProjectsManager) DeleteStorageSpace added in v3.2.0

func (*ProjectsManager) GetProject added in v3.2.0

func (m *ProjectsManager) GetProject(ctx context.Context, name string) (*Project, error)

func (*ProjectsManager) GetStorageSpace added in v3.2.0

func (m *ProjectsManager) GetStorageSpace(ctx context.Context, name string) (*provider.StorageSpace, error)

func (*ProjectsManager) GroupFiltersByType added in v3.2.0

GroupFiltersByType groups the given filters and returns a map using the filter type as the key.

func (*ProjectsManager) ListStorageSpaces added in v3.2.0

func (*ProjectsManager) UpdateStorageSpace added in v3.2.0

Jump to

Keyboard shortcuts

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