logics

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package logics request logical scheduler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(i iris.Context, logic Logic)

Do a logical process.

Types

type Classes added in v1.0.1

type Classes interface {
	Build(i iris.Context, logic Logic) (logical Logical, name string, err error)
}
var Class Classes

type Logic

type Logic func() Logical

Logic is a constructor func used to creates an instance of a Logical.

1. Define a constructor:

func New() framework.Logical {
    return &YourLogic{}
}

2. Use logic in controller or handler.

framework.Do(i, New)

type Logical

type Logical interface {
	Run(ctx context.Context, i iris.Context) result.Result
}

Logical is a required method used to run logic process.

type LogicalAfter

type LogicalAfter interface {
	After(ctx context.Context, i iris.Context, res result.Result)
}

LogicalAfter is an optional hook use to repair response result if implemented.

type LogicalBefore

type LogicalBefore interface {
	Before(ctx context.Context, i iris.Context) (err error)
}

LogicalBefore is an optional hook used to validate request body if implemented. Skip logical runner hook and chained hooks if error returned.

type LogicalClassName added in v1.0.1

type LogicalClassName interface {
	SetClassName(name string)
}

type LogicalReleaser

type LogicalReleaser interface {
	Release()
}

LogicalReleaser is an optional hook used to release Logical instance to pool if implemented.

Jump to

Keyboard shortcuts

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