search

package
v0.0.0-...-8f9ce2e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddClause

func AddClause(column string, query sq.SelectBuilder, params *Param) sq.SelectBuilder

func AddEqClause

func AddEqClause(column string, query sq.SelectBuilder, params []*Param) sq.SelectBuilder

func Configure

func Configure(l *goapp.Lifecycle, conf *config.Config)

func GetEmbedFS

func GetEmbedFS() embed.FS

func GetJsonQuery

func GetJsonQuery(left string, sep string) string

func GetJsonSearchQuery

func GetJsonSearchQuery(query sq.SelectBuilder, params []*Param, field string) sq.SelectBuilder

Types

type HttpSearchForm

type HttpSearchForm struct {
	Page       int64               `schema:"page"`
	PerPage    int64               `schema:"per_page"`
	OrderBy    []string            `schema:"order_by"`
	Uuid       []string            `schema:"uuid"`
	Type       []string            `schema:"type"`
	Name       string              `schema:"name"`
	Slug       string              `schema:"slug"`
	Data       map[string][]string `schema:"data"`
	Meta       map[string][]string `schema:"meta"`
	Status     []string            `schema:"status"`
	Weight     []string            `schema:"weight"`
	Revision   string              `schema:"revision"`
	Enabled    string              `schema:"enabled"`
	Deleted    string              `schema:"deleted"`
	Current    string              `schema:"current"`
	UpdatedBy  []string            `schema:"updated_by"`
	CreatedBy  []string            `schema:"created_by"`
	ParentUuid []string            `schema:"parent_uuid"`
	SetUuid    []string            `schema:"set_uuid"`
	Source     []string            `schema:"source"`
}

func GetHttpSearchForm

func GetHttpSearchForm() *HttpSearchForm

type HttpSearchParser

type HttpSearchParser struct {
	MaxResult uint64
}

func (*HttpSearchParser) HandleSearch

func (h *HttpSearchParser) HandleSearch(res http.ResponseWriter, req *http.Request) *SearchForm

type Index

type Index struct {
	Page       int64    `json:"page"`
	PerPage    int64    `json:"per_page"`
	OrderBy    []*Param `json:"order_by"`
	Uuid       []*Param `json:"uuid"`
	Type       []*Param `json:"type"`
	Name       *Param   `json:"name"`
	Slug       *Param   `json:"slug"`
	Data       []*Param `json:"data"`
	Meta       []*Param `json:"meta"`
	Status     []*Param `json:"status"`
	Weight     []*Param `json:"weight"`
	Revision   *Param   `json:"revision"`
	Enabled    *Param   `json:"enabled"`
	Deleted    *Param   `json:"deleted"`
	Current    *Param   `json:"current"`
	UpdatedBy  []*Param `json:"updated_by"`
	CreatedBy  []*Param `json:"created_by"`
	ParentUuid []*Param `json:"parent_uuid"`
	SetUuid    []*Param `json:"set_uuid"`
	Source     []*Param `json:"source"`
}

type IndexHandler

type IndexHandler struct {
}

func (*IndexHandler) GetDownloadData

func (h *IndexHandler) GetDownloadData(node *base.Node) *base.DownloadData

func (*IndexHandler) GetStruct

func (h *IndexHandler) GetStruct() (base.NodeData, base.NodeMeta)

func (*IndexHandler) Load

func (h *IndexHandler) Load(data []byte, meta []byte, node *base.Node) error

func (*IndexHandler) PostInsert

func (h *IndexHandler) PostInsert(node *base.Node, m base.NodeManager) error

func (*IndexHandler) PostUpdate

func (h *IndexHandler) PostUpdate(node *base.Node, m base.NodeManager) error

func (*IndexHandler) PreInsert

func (h *IndexHandler) PreInsert(node *base.Node, m base.NodeManager) error

func (*IndexHandler) PreUpdate

func (h *IndexHandler) PreUpdate(node *base.Node, m base.NodeManager) error

func (*IndexHandler) StoreStream

func (h *IndexHandler) StoreStream(node *base.Node, r io.Reader) (int64, error)

func (*IndexHandler) Validate

func (h *IndexHandler) Validate(node *base.Node, m base.NodeManager, errors base.Errors)

type IndexMeta

type IndexMeta struct {
	Format string `json:"format"`
}

type IndexViewHandler

type IndexViewHandler struct {
	Search    *SearchPGSQL
	Manager   base.NodeManager
	MaxResult uint64
}

func (*IndexViewHandler) Execute

func (v *IndexViewHandler) Execute(node *base.Node, request *base.ViewRequest, response *base.ViewResponse) error

func (*IndexViewHandler) Support

func (v *IndexViewHandler) Support(node *base.Node, request *base.ViewRequest, response *base.ViewResponse) bool

type Param

type Param struct {
	SubField  string      `json:"sub_field"`
	Operation string      `json:"operation"`
	Value     interface{} `json:"value"`
}

func NewParam

func NewParam(v interface{}, options ...string) *Param

type SearchForm

type SearchForm struct {
	Page       uint64   `json:"page"`
	PerPage    uint64   `json:"per_page"`
	OrderBy    []*Param `json:"order_by"`
	Uuid       []*Param `json:"uuid"`
	Type       []*Param `json:"type"`
	Name       *Param   `json:"name"`
	Slug       *Param   `json:"slug"`
	Data       []*Param `json:"data"`
	Meta       []*Param `json:"meta"`
	Status     []*Param `json:"status"`
	Weight     []*Param `json:"weight"`
	Revision   *Param   `json:"revision"`
	Enabled    *Param   `json:"enabled"`
	Deleted    *Param   `json:"deleted"`
	Current    *Param   `json:"current"`
	UpdatedBy  []*Param `json:"updated_by"`
	CreatedBy  []*Param `json:"created_by"`
	ParentUuid []*Param `json:"parent_uuid"`
	SetUuid    []*Param `json:"set_uuid"`
	Source     []*Param `json:"source"`
}

func NewSearchForm

func NewSearchForm() *SearchForm

func NewSearchFormFromIndex

func NewSearchFormFromIndex(index *Index) *SearchForm

func (*SearchForm) UrlValues

func (s *SearchForm) UrlValues() url.Values

type SearchPGSQL

type SearchPGSQL struct {
}

func (*SearchPGSQL) BuildQuery

func (s *SearchPGSQL) BuildQuery(searchForm *SearchForm, query sq.SelectBuilder) sq.SelectBuilder

type SearchPager

type SearchPager struct {
	Elements []*base.Node
	Page     uint64
	PerPage  uint64
	Next     uint64
	Previous uint64
	Form     *SearchForm
}

func GetPager

func GetPager(form *SearchForm, manager base.NodeManager, engine *SearchPGSQL, options *base.AccessOptions) *SearchPager

func (*SearchPager) PageQuery

func (s *SearchPager) PageQuery(page uint64) url.Values

Jump to

Keyboard shortcuts

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