controller

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKey = "id"

Functions

This section is empty.

Types

type Base

type Base struct {
}

func (*Base) GetAction

func (e *Base) GetAction(_ string) response.Action

func (*Base) GetKey

func (e *Base) GetKey() string

GetKey get key

func (*Base) Handlers

func (e *Base) Handlers() gin.HandlersChain

func (*Base) Other

func (e *Base) Other(_ *gin.RouterGroup)

func (*Base) Path

func (e *Base) Path() string

type Option

type Option func(*Options)

Option set options

func WithAction

func WithAction(action response.Action) Option

WithAction set action

func WithAuth

func WithAuth(auth bool) Option

WithAuth set auth

func WithModel

func WithModel(m actions.Model) Option

WithModel set model

func WithModelProvider added in v0.1.1

func WithModelProvider(provider actions.ModelProvider) Option

WithModelProvider set model provider

func WithSearch

func WithSearch(search response.Searcher) Option

WithSearch set search

type Options

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

Options options

func DefaultOptions

func DefaultOptions() Options

DefaultOptions make default options

type Simple

type Simple struct {
	Base
	// contains filtered or unexported fields
}

Simple controller

func NewSimple

func NewSimple(options ...Option) *Simple

NewSimple new simple

func (*Simple) GetAction

func (e *Simple) GetAction(key string) response.Action

GetAction get action

func (*Simple) Handlers

func (e *Simple) Handlers() gin.HandlersChain

Handlers return handlers

func (*Simple) Path

func (e *Simple) Path() string

Path route path

Jump to

Keyboard shortcuts

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