open_ikuai

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 11 Imported by: 0

README

Open IKuai SDK

https://open.ikuai8.com/

Open IKuai 3.0 SDK,封装了部分爱快的接口。 https://open.ikuai8.com/doc/3.0/

依赖
go get -u https://github.com/zy84338719/open_ikuai
使用
var l = NewLogic("-----BEGIN PUBLIC KEY-----\n"+
""+
"\n-----END PUBLIC KEY-----", "")

l.InitRam(context.Background())

got, err := l.GetRouterInfo(context.Background(), "gwid")
log.Printf("%+v %+v", got, err)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logic

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

func NewLogic

func NewLogic(pubKey, clientId string) *Logic

func (*Logic) AccessToken

func (l *Logic) AccessToken(ctx context.Context) (*model.TokenResponse, error)

AccessToken token 获取

func (*Logic) AccountCreation

func (l *Logic) AccountCreation(ctx context.Context, gwid string, req model.AccountData) error

AccountCreation 创建用户

func (*Logic) AccountDelete

func (l *Logic) AccountDelete(ctx context.Context, gwid string, id int64) error

AccountDelete 账户删除

func (*Logic) AccountEdit

func (l *Logic) AccountEdit(ctx context.Context, gwid string, req model.AccountData) error

AccountEdit 账户编辑

func (*Logic) AccountList

func (l *Logic) AccountList(ctx context.Context, gwid string) ([]model.AccountData, error)

AccountList 获取账号列表

func (*Logic) AccountStatus

func (l *Logic) AccountStatus(ctx context.Context, gwid string, id int64, status model.AccountStatus) error

AccountStatus 账户状态

func (*Logic) CouponAdding

func (l *Logic) CouponAdding(ctx context.Context, gwid string, req model.CouponParam) error

CouponAdding 添加优惠券

func (*Logic) CouponDelete

func (l *Logic) CouponDelete(ctx context.Context, gwid string, id int64) error

CouponDelete 删除优惠券

func (*Logic) CouponEdit

func (l *Logic) CouponEdit(ctx context.Context, gwid string, req model.CouponParam) error

CouponEdit 编辑优惠券

func (*Logic) CouponList

func (l *Logic) CouponList(ctx context.Context, gwid string, skip, limit int64) ([]model.Coupon, error)

CouponList 优惠券列表

func (*Logic) CustomAuthUserDelete

func (l *Logic) CustomAuthUserDelete(ctx context.Context, gwid string, username string) error

CustomAuthUserDelete 删除自定义认证信息

func (*Logic) CustomAuthUserUpdate

func (l *Logic) CustomAuthUserUpdate(ctx context.Context, gwid string, req model.Draft) error

CustomAuthUserUpdate 更新自定义认证信息

func (*Logic) FindAccountByUsername

func (l *Logic) FindAccountByUsername(ctx context.Context, gwid string, username string) ([]model.AccountData, error)

FindAccountByUsername 查看用户

func (*Logic) GetCustomAuthUserList

func (l *Logic) GetCustomAuthUserList(ctx context.Context, gwid string) ([]model.Draft, error)

GetCustomAuthUserList 获取自定义认证用户列表

func (*Logic) GetDeviceList

func (l *Logic) GetDeviceList(ctx context.Context) ([]model.Device, error)

GetDeviceList 获取设备列表

func (*Logic) GetRouterInfo

func (l *Logic) GetRouterInfo(ctx context.Context, gwid string) (*model.RouterBasic, error)

GetRouterInfo 获取路由信息

func (*Logic) InitRam

func (l *Logic) InitRam(ctx context.Context) error

InitRam 初始化到内存

func (*Logic) OnlineUserKickByMac

func (l *Logic) OnlineUserKickByMac(ctx context.Context, gwid string, mac string) error

OnlineUserKickByMac 强制用户下线ByMac

func (*Logic) OnlineUserKickByUserName

func (l *Logic) OnlineUserKickByUserName(ctx context.Context, gwid string, username string) error

OnlineUserKickByUserName 强制用户下线ByUserName

func (*Logic) OnlineUserList

func (l *Logic) OnlineUserList(ctx context.Context, gwid string, skip, limit int64) ([]model.OnlineUser, error)

OnlineUserList 用户在线列表

func (*Logic) PushCustomAuthInfo

func (l *Logic) PushCustomAuthInfo(ctx context.Context, gwid string, req model.Draft) ([]model.Draft, error)

PushCustomAuthInfo 推送更新自定义认证信息

func (*Logic) RefreshToken

func (l *Logic) RefreshToken(ctx context.Context, accessToken, clientId string) (*model.TokenResponse, error)

RefreshToken token 刷新

func (*Logic) SetRouterWebWhiteList

func (l *Logic) SetRouterWebWhiteList(ctx context.Context, gwid string, webList model.WhiteList) error

SetRouterWebWhiteList 获取网络白名单

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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