sql

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: Apache-2.0 Imports: 19 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 {
	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
	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.

Jump to

Keyboard shortcuts

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