pgdb

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

View Source
const (
	NoPermission DbPermission = 0
	Guest                     = 1
	Read                      = 2
	Write                     = 4
	Delete                    = 8
	Administer                = 16
	Owner                     = 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Contributor added in v1.4.0

type Contributor struct {
	Id            int64          `json:"id"`
	FirstName     string         `json:"first_name"`
	LastName      string         `json:"last_name"`
	Email         string         `json:"email"`
	Orcid         sql.NullString `json:"orcid"`
	UserId        sql.NullInt64  `json:"user_id"`
	UpdatedAt     time.Time      `json:"updated_at"`
	CreatedAt     time.Time      `json:"created_at"`
	MiddleInitial sql.NullString `json:"middle_initial"`
	Degree        sql.NullString `json:"degree"`
}

type Contributors

type Contributors []string

func (*Contributors) Scan

func (c *Contributors) Scan(src any) error

func (Contributors) Value

func (c Contributors) Value() (driver.Value, error)

type DataUseAgreement added in v1.4.0

type DataUseAgreement struct {
	Id          int64     `json:"id"`
	Name        string    `json:"name"`
	Body        string    `json:"body"`
	CreatedAt   time.Time `json:"created_at"`
	IsDefault   bool      `json:"is_default"`
	Description string    `json:"description"`
}

type Dataset

type Dataset struct {
	Id                           int64          `json:"id"`
	Name                         string         `json:"name"`
	State                        string         `json:"state"`
	Description                  sql.NullString `json:"description"`
	UpdatedAt                    time.Time      `json:"updated_at"`
	CreatedAt                    time.Time      `json:"created_at"`
	NodeId                       sql.NullString `json:"node_id"`
	PermissionBit                sql.NullInt32  `json:"permission_bit"`
	Type                         string         `json:"type"`
	Role                         sql.NullString `json:"role"`
	Status                       string         `json:"status"`
	AutomaticallyProcessPackages bool           `json:"automatically_process_packages"`
	License                      sql.NullString `json:"license"`
	Tags                         Tags           `json:"tags"`
	Contributors                 Contributors   `json:"contributors"`
	BannerId                     uuid.UUID      `json:"banner_id"`
	ReadmeId                     uuid.UUID      `json:"readme_id"`
	StatusId                     int32          `json:"status_id"`
	PublicationStatusId          sql.NullInt32  `json:"publication_status_id"`
	Size                         sql.NullInt64  `json:"size"`
	ETag                         time.Time      `json:"etag"`
	DataUseAgreementId           sql.NullInt32  `json:"data_use_agreement_id"`
	ChangelogId                  uuid.NullUUID  `json:"changelog_id"`
}

type DatasetContributor added in v1.4.0

type DatasetContributor struct {
	DatasetId        int64     `json:"dataset_id"`
	ContributorId    int64     `json:"contributor_id"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	ContributorOrder int64     `json:"contributor_order"`
}

type DatasetRelease added in v1.9.0

type DatasetRelease struct {
	Id               int64          `json:"id"`
	DatasetId        int64          `json:"dataset_id"`
	Origin           string         `json:"origin"`
	Url              string         `json:"url"`
	Label            sql.NullString `json:"label"`
	Marker           sql.NullString `json:"marker"`
	Properties       Properties     `json:"properties"`
	Tags             Tags           `json:"tags"`
	ReleaseDate      sql.NullTime   `json:"release_date"`
	ReleaseStatus    string         `json:"release_status"`
	PublishingStatus string         `json:"publishing_status"`
	CreatedAt        time.Time      `json:"created_at"`
	UpdatedAt        time.Time      `json:"updated_at"`
}

type DatasetReleaseDTO added in v1.9.0

type DatasetReleaseDTO struct {
	Dataset Dataset        `json:"dataset"`
	Release DatasetRelease `json:"release"`
}

type DatasetStatus added in v1.4.0

type DatasetStatus struct {
	Id           int64     `json:"id"`
	Name         string    `json:"name"`
	DisplayName  string    `json:"display_name"`
	OriginalName string    `json:"original_name"`
	Color        string    `json:"color"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

type DatasetStorage

type DatasetStorage struct {
	DatasetId int64 `json:"dataset_id"`
	Size      int64 `json:"size"`
}

type DatasetTeam

type DatasetTeam struct {
	DatasetId int64     `json:"dataset_id"`
	TeamId    int64     `json:"team_id"`
	Role      role.Role `json:"role"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type DatasetUser

type DatasetUser struct {
	DatasetId     int64     `json:"dataset_id"`
	UserId        int64     `json:"user_id"`
	Role          string    `json:"role"`
	PermissionBit int64     `json:"permission_bit"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

type DbPermission

type DbPermission int64

func FromRole added in v1.10.0

func FromRole(role string) DbPermission

func (DbPermission) AsRoleString added in v1.10.0

func (s DbPermission) AsRoleString() string

func (DbPermission) String

func (s DbPermission) String() string

type ErrFileNotFound

type ErrFileNotFound struct{}

func (*ErrFileNotFound) Error

func (m *ErrFileNotFound) Error() string

type ErrMultipleRowsAffected

type ErrMultipleRowsAffected struct{}

func (*ErrMultipleRowsAffected) Error

func (m *ErrMultipleRowsAffected) Error() string

type FeatureFlags

type FeatureFlags struct {
	OrganizationId int64     `json:"organization_id"`
	Feature        string    `json:"feature"`
	Enabled        bool      `json:"enabled"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type File

type File struct {
	Id              string                          `json:"id"`
	PackageId       int                             `json:"package_id"`
	Name            string                          `json:"name"`
	FileType        fileType.Type                   `json:"file_type"`
	S3Bucket        string                          `json:"s3_bucket"`
	S3Key           string                          `json:"s3_key"`
	ObjectType      objectType.ObjectType           `json:"object_type"`
	Size            int64                           `json:"size"`
	CheckSum        string                          `json:"checksum"`
	UUID            uuid.UUID                       `json:"uuid"`
	ProcessingState processingState.ProcessingState `json:"processing_state"`
	UploadedState   uploadState.UploadedState       `json:"uploaded_state"`
	CreatedAt       time.Time                       `json:"created_at"`
	UpdatedAt       time.Time                       `json:"updated_at"`
}

type FileParams

type FileParams struct {
	PackageId  int                   `json:"package_id"`
	Name       string                `json:"name"`
	FileType   fileType.Type         `json:"file_type"`
	S3Bucket   string                `json:"s3_bucket"`
	S3Key      string                `json:"s3_key"`
	ObjectType objectType.ObjectType `json:"object_type"`
	Size       int64                 `json:"size"`
	CheckSum   string                `json:"checksum"`
	Sha256     string                `json:"sha256"`
	UUID       uuid.UUID             `json:"uuid"`
}

type Organization

type Organization struct {
	Id            int64          `json:"id"`
	Name          string         `json:"name"`
	Slug          string         `json:"slug"`
	NodeId        string         `json:"node_id"`
	StorageBucket sql.NullString `json:"storage_bucket"`
	PublishBucket sql.NullString `json:"publish_bucket"`
	EmbargoBucket sql.NullString `json:"embargo_bucket"`
	CreatedAt     time.Time      `json:"created_at"`
	UpdatedAt     time.Time      `json:"updated_at"`
}

type OrganizationStorage

type OrganizationStorage struct {
	OrganizationId int64 `json:"organization_id"`
	Size           int64 `json:"size"`
}

type OrganizationUser

type OrganizationUser struct {
	OrganizationId int64        `json:"organization_id"`
	UserId         int64        `json:"user_id"`
	DbPermission   DbPermission `json:"permission_bit"`
	CreatedAt      time.Time    `json:"created_at"`
	UpdatedAt      time.Time    `json:"updated_at"`
}

type Package

type Package struct {
	Id           int64                         `json:"id"`
	Name         string                        `json:"name"`
	PackageType  packageType.Type              `json:"type"`
	PackageState packageState.State            `json:"state"`
	NodeId       string                        `json:"node_id"`
	ParentId     sql.NullInt64                 `json:"parent_id"`
	DatasetId    int                           `json:"dataset_id"`
	OwnerId      int                           `json:"owner_id"`
	Size         sql.NullInt64                 `json:"size"`
	ImportId     sql.NullString                `json:"import_id"`
	Attributes   packageInfo.PackageAttributes `json:"attributes"`
	CreatedAt    time.Time                     `json:"created_at"`
	UpdatedAt    time.Time                     `json:"updated_at"`
}

Package is a representation of a container on Pennsieve that contains one or more sourceFiles

type PackageMap

type PackageMap = map[string]Package

PackageMap maps path to models.Package

type PackageParams

type PackageParams struct {
	Name         string                        `json:"name"`
	PackageType  packageType.Type              `json:"type"`
	PackageState packageState.State            `json:"state"`
	NodeId       string                        `json:"node_id"`
	ParentId     int64                         `json:"parent_id"`
	DatasetId    int                           `json:"dataset_id"`
	OwnerId      int                           `json:"owner_id"`
	Size         int64                         `json:"size"`
	ImportId     sql.NullString                `json:"import_id"`
	Attributes   packageInfo.PackageAttributes `json:"attributes"`
}

PackageParams is used as the input to create a package ParentID is not an optional and -1 refers to the root folder.

type PackageStorage

type PackageStorage struct {
	PackageId int64 `json:"package_id"`
	Size      int64 `json:"size"`
}

type Properties added in v1.9.0

type Properties map[string]interface{}

type Tags

type Tags []string

func (*Tags) Scan

func (t *Tags) Scan(src any) error

func (Tags) Value

func (t Tags) Value() (driver.Value, error)

type Token

type Token struct {
	Id             int64     `json:"id"`
	Name           string    `json:"name"`
	Token          string    `json:"token"`
	OrganizationId string    `json:"organization_id"`
	UserId         bool      `json:"user_id"`
	CognitoId      string    `json:"cognito_id"`
	LastUsed       int64     `json:"last_used"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type User

type User struct {
	Id           int64  `json:"id"`
	NodeId       string `json:"node_id"`
	Email        string `json:"email"`
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	IsSuperAdmin bool   `json:"is_super_admin"`
	PreferredOrg int64  `json:"preferred_org_id"`
}

Jump to

Keyboard shortcuts

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