emq

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AclAllow  AclResult = "allow"
	AclDeny             = "deny"
	AclIgnore           = "ignore"
)
View Source
const (
	AuthAllow  AuthResult = "allow"
	AuthDeny              = "deny"
	AuthIgnore            = "ignore"
)
View Source
const (
	RespCodeSuccess      = 200
	RespCodeNotFound     = 404
	RespCodeUnauthorized = 401
)
View Source
const (
	RespMsgNotFount = "not found"
	RespMsgIdNum    = "id must be a int value"
)
View Source
const (
	DefaultTimeFormatter = "2006-01-02:15:04:05"
	DefaultCodeLen       = 16
)

Variables

This section is empty.

Functions

func Acl

func Acl(ctx iris.Context)

func Auth

func Auth(ctx iris.Context)

Auth http://host:port/mqtt/auth clientid=%c,username=%u,password=%P

func FormatTime

func FormatTime(t time.Time) (s string)

func ResponseJSON

func ResponseJSON(ctx iris.Context, j interface{})

func Router

func Router(root iris.Party)

Types

type AclReq

type AclReq struct {
	Username string
	Topic    string
	Action   string
}

type AclResp

type AclResp struct {
	Result AuthResult `json:"result,omitempty"`
}

type AclResult

type AclResult string

type AuthReq

type AuthReq struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type AuthResp

type AuthResp struct {
	Result      AuthResult `json:"result,omitempty"`
	IsSuperuser bool       `json:"is_superuser,omitempty"`
}

type AuthResult

type AuthResult string

Jump to

Keyboard shortcuts

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