emqx

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator = string
var (
	PasswordBased_BuildInDatabase Authenticator = `password_based:built_in_database`
)

type Client

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

func NewClient

func NewClient(apiurl, appid, appscret string, opts ...ClientOptions) *Client

func (*Client) CreateUsername

func (c *Client) CreateUsername(ctx context.Context, id Authenticator, uid string, password string) error

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, id Authenticator, uid string) error

func (*Client) GetAuthUser

func (c *Client) GetAuthUser(ctx context.Context, id Authenticator, uid string) (*GetAuthUserResp, error)

func (*Client) GetAuthUsers

func (c *Client) GetAuthUsers(ctx context.Context, id Authenticator, query *GetAuthUsersReq) (*GetAuthUsersResp, error)

func (*Client) SetApiUrl

func (c *Client) SetApiUrl(apiurl string)

func (*Client) SetUserPassword

func (c *Client) SetUserPassword(ctx context.Context, id Authenticator, uid string, password string) error

type ClientOptions

type ClientOptions func(*Client)

func WithHttpClient

func WithHttpClient(hcli *http.Client) ClientOptions

type CodeResp

type CodeResp struct {
	Code string `json:"code"`
}

type CreateUserReq

type CreateUserReq struct {
	UserID   string `json:"user_id,omitempty"`
	Password string `json:"password"`
}

type CreateUserResp

type CreateUserResp = CodeResp

type GetAuthUserResp

type GetAuthUserResp struct {
	UserID      string `json:"user_id"`
	IsSuperUser bool   `json:"is_superuser"`
}

type GetAuthUsersReq

type GetAuthUsersReq struct {
	Page        int
	Limit       int
	LikeUserID  string
	IsSuperUser bool
}

type GetAuthUsersResp

type GetAuthUsersResp struct {
	Meta struct {
		Page    int  `json:"page"`
		Limit   int  `json:"limit"`
		Count   int  `json:"count"`
		Hasnext bool `json:"hasnext"`
	} `json:"meta"`
	GetAuthUserResp `json:"data"`
	Code            int `json:"code"`
}

Jump to

Keyboard shortcuts

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