redirects

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package redirects represents the redirect resource

Index

Constants

View Source
const (
	// TableName is the database table for this resource
	TableName = "redirects"
	// KeyName is the primary key value for this resource
	KeyName = "id"
	// Order defines the default sort order in sql for this resource
	Order = "updated_at desc"
)

Variables

This section is empty.

Functions

func AllowedParams

func AllowedParams() []string

AllowedParams returns an array of allowed param keys for Update and Create.

func Query

func Query() *query.Query

Query returns a new query for redirects with a default order.

func Where

func Where(format string, args ...interface{}) *query.Query

Where returns a new query for redirects with the format and arguments supplied.

Types

type Redirect

type Redirect struct {
	// resource.Base defines behaviour and fields shared between all resources
	resource.Base

	NewURL string
	OldURL string
}

Redirect handles saving and retreiving redirects from the database

func Find

func Find(id int64) (*Redirect, error)

Find fetches a single redirect record from the database by id.

func FindAll

func FindAll(q *query.Query) ([]*Redirect, error)

FindAll fetches all redirect records matching this query from the database.

func FindFirst

func FindFirst(format string, args ...interface{}) (*Redirect, error)

FindFirst fetches a single redirect record from the database using a where query with the format and args provided.

func New

func New() *Redirect

New creates and initialises a new redirect instance.

func NewWithColumns

func NewWithColumns(cols map[string]interface{}) *Redirect

NewWithColumns creates a new redirect instance and fills it with data from the database cols provided.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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