models

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DB is the example application's database
	DB = local.Database("example.db")

	// Auth is the DB's authentication collection
	Auth = authentication.Manage(DB)

	// Ducks is a collection of our Ducks model
	Ducks = database.Manage(DB, new(Duck))
)

Functions

This section is empty.

Types

type Duck

type Duck struct {
	application.Model
	Name  string
	Breed string
}

Duck is the model for storing ducks

func DucksByBreed

func DucksByBreed(breed string) ([]*Duck, error)

GetDuckByBreed returns a list of ducks

func DucksByName

func DucksByName(name string) (*Duck, error)

GetDuckByName returns a single named duck

func GetDuckByID

func GetDuckByID(id string) (*Duck, error)

GetDuckByID returns a duck by its ID

func (*Duck) Quack

func (d *Duck) Quack() string

Quack is a public method that can be called in views

func (*Duck) Table

func (*Duck) Table() string

Table is the name of the table where ducks are stored

Jump to

Keyboard shortcuts

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