api

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKey = "id"

DefaultKey default key

Functions

This section is empty.

Types

type Base

type Base struct{}

Base controller

func (*Base) GetAction

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

GetAction get action

func (*Base) GetKey

func (e *Base) GetKey() string

GetKey get key

func (*Base) Handlers

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

Handlers middlewares

func (*Base) Other

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

Other handler

func (*Base) Path

func (e *Base) Path() string

Path http path

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 model.ModelImpl) Option

WithModel set model

func WithModelProvider

func WithModelProvider(provider model.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 Virtual

type Virtual struct {
	Base

	Provider *action.Base
	// contains filtered or unexported fields
}

Virtual controller

func NewVirtual

func NewVirtual(provider *action.Base, options ...Option) *Virtual

NewVirtual new virtual controller

func (*Virtual) GetAction

func (v *Virtual) GetAction(key string) response.Action

GetAction get action

func (*Virtual) GetProvider added in v0.2.1

func (v *Virtual) GetProvider() fmt.Stringer

func (*Virtual) Handlers

func (v *Virtual) Handlers() gin.HandlersChain

Handlers middlewares

func (*Virtual) Path

func (v *Virtual) Path() string

Path http path

Jump to

Keyboard shortcuts

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