sql

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 20 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 {
	Engine     string `mapstructure:"engine"` // mysql | sqlite
	DBUsername string `mapstructure:"db_username"`
	DBPassword string `mapstructure:"db_password"`
	DBHost     string `mapstructure:"db_host"`
	DBPort     int    `mapstructure:"db_port"`
	DBName     string `mapstructure:"db_name"`
	// 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 mysql driver implementing the projects.Catalogue interface.

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