iris

package module
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 9 Imported by: 0

README

Iris

什么是Iris?

Iris是一款Go语言中用来开发web应用的框架,该框架支持编写一次并在任何地方以最小的机器功率运行,如Android、ios、Linux和Windows等。

该框架只需要一个可执行的服务就可以在平台上运行了。

Iris框架以简单而强大的api而被开发者所熟悉。iris除了为开发者提供非常简单的访问方式外,还同样支持MVC。

另外,用iris构建微服务也很容易。

在iris框架的官方网站上,被称为速度最快的Go后端开发框架。

在Iris的网站文档上,列出了该框架具备的一些特点和框架特性,列举如下:

  1. 聚焦高性能
  2. 健壮的静态路由支持和通配符子域名支持
  3. 视图系统支持超过5以上模板
  4. 支持定制事件的高可扩展性Websocket API
  5. 带有GC, 内存 & redis 提供支持的会话
  6. 方便的中间件和插件
  7. 完整 REST API
  8. 能定制 HTTP 错误
  9. 源码改变后自动加载

参考资料

Documentation

Index

Constants

View Source
const (
	KindIris transport.Kind = "iris"
)

Variables

This section is empty.

Functions

func SetOperation

func SetOperation(ctx context.Context, op string)

SetOperation sets the transport operation.

Types

type Server

type Server struct {
	*iris.Application
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts ...ServerOption) *Server

func (*Server) Endpoint

func (s *Server) Endpoint() (*url.URL, error)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(res http.ResponseWriter, req *http.Request)

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

type ServerOption

type ServerOption func(*Server)

func WithAddress

func WithAddress(addr string) ServerOption

func WithTLSConfig

func WithTLSConfig(certFile, keyFile string) ServerOption

func WithTimeout

func WithTimeout(timeout time.Duration) ServerOption

type Transport

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

Transport is an HTTP transport.

func (*Transport) Endpoint

func (tr *Transport) Endpoint() string

Endpoint returns the transport endpoint.

func (*Transport) Kind

func (tr *Transport) Kind() transport.Kind

Kind returns the transport kind.

func (*Transport) Operation

func (tr *Transport) Operation() string

Operation returns the transport operation.

func (*Transport) PathTemplate

func (tr *Transport) PathTemplate() string

PathTemplate returns the http path template.

func (*Transport) ReplyHeader

func (tr *Transport) ReplyHeader() transport.Header

ReplyHeader returns the reply header.

func (*Transport) Request

func (tr *Transport) Request() *http.Request

Request returns the HTTP request.

func (*Transport) RequestHeader

func (tr *Transport) RequestHeader() transport.Header

RequestHeader returns the request header.

type Transporter

type Transporter interface {
	transport.Transporter
	Request() *http.Request
	PathTemplate() string
}

Transporter is http Transporter

Jump to

Keyboard shortcuts

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