collections

package
v0.0.0-...-ff9d945 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package collections provides ways to interact with the collections, such as checking who owns a collection

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	models.BaseModel
	Name        string `db:"name" json:"name"`
	User        string `db:"user" json:"user"`
	Group       string `db:"group" json:"group"`
	CustomOrder int    `db:"custom_order" json:"custom_order"`
}

Collection models the data in the `collections` collection.

func (*Collection) TableName

func (m *Collection) TableName() string

TableName returns the name of the model in PocketBase.

type Repository

type Repository interface {
	GetByID(id string) (*Collection, error)
}

Repository used to interact with the database

type SQLiteStore

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

SQLiteStore used to interact with DB

func NewStore

func NewStore(app core.App) SQLiteStore

NewStore returns a new store to interact with the database

func (SQLiteStore) GetByID

func (s SQLiteStore) GetByID(id string) (*Collection, error)

GetByID returns a record by ID

type Service

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

Service used to interact with the collection

func NewService

func NewService(repo Repository) Service

NewService returns a new struct used to interact with this module

func (Service) IsCollectionOwnedBy

func (s Service) IsCollectionOwnedBy(collectionID string, userID string) (bool, error)

IsCollectionOwnedBy checks if a collection is owned by user

Jump to

Keyboard shortcuts

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