dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

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

Dao dao.

func New

func New(c *conf.Config) (d *Dao)

New new a dao.

func (*Dao) AddAuth

func (d *Dao) AddAuth(c context.Context, zoneids map[int64]map[int64]int64) (err error)

AddAuth add zone rule from redis

func (*Dao) Auth

func (d *Dao) Auth(c context.Context, aid int64, zoneids []int64) (res []int64, err error)

Auth get zone rule from redis

func (*Dao) CheckVersion

func (d *Dao) CheckVersion(c context.Context) (version *model.Version, err error)

func (*Dao) Close

func (d *Dao) Close() (err error)

Close close a dao.

func (*Dao) DownIPLibrary

func (d *Dao) DownIPLibrary(c context.Context, version, file string) (err error)

func (*Dao) DownloadAnonym

func (d *Dao) DownloadAnonym() (err error)

DownloadAnonym download anonym file.

func (*Dao) ExistsAuth

func (d *Dao) ExistsAuth(c context.Context, aid int64) (ok bool, err error)

ExistsAuth if existes ruls in redis.

func (*Dao) GroupAuthZone

func (d *Dao) GroupAuthZone(c context.Context) (res map[int64]map[int64]map[int64]int64, err error)

GroupAuthZone zone_id by group_id.

func (*Dao) GroupPolicies

func (d *Dao) GroupPolicies(c context.Context) (res map[int64][]int64, err error)

GroupPolicies get policy data from db group by group_id

func (*Dao) Groupid

func (d *Dao) Groupid(c context.Context, aid int64) (gid int64, err error)

Groupid get gid from db by aid

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) (err error)

Ping ping a dao.

func (*Dao) Policies

func (d *Dao) Policies(c context.Context) (res map[int64]map[int64]int64, err error)

Policies get policy data from db

Jump to

Keyboard shortcuts

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