dao

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

* Copyright (c) 2019. Baidu Inc. All Rights Reserved.

* Copyright (c) 2019. Baidu Inc. All Rights Reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMysqlConnect

func InitMysqlConnect() (string, error)

初始化mysql connect配置

func InitMysqlTable

func InitMysqlTable()

初始化mysqldb

func InitTables

func InitTables()

DB目前仅支持sqlite3, front启动时会校验是否存在sqlite3 db文件, 如果db不存在则自动创建

Types

type CaDb

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

func GetDbInstance

func GetDbInstance() *CaDb

func NewCaDb

func NewCaDb() (connection *CaDb)

type Revoke

type Revoke struct {
	Id         int    `db:"id"`
	Net        string `db:"net"`
	SerialNum  string `db:"serial_num"`
	CreateTime int    `db:"create_time"`
}

type RevokeDao

type RevokeDao struct {
}

front 本地的撤销节点列表

func (*RevokeDao) GetBySerialNum

func (revokeDao *RevokeDao) GetBySerialNum(serialNum string) (*Revoke, error)

通过serialNum查询是否存在已撤销的证书

func (*RevokeDao) GetLatestSerialNum

func (revokeDao *RevokeDao) GetLatestSerialNum(net string) (string, error)

获取数据库中最后写入的撤销证书serialNum

func (*RevokeDao) Insert

func (revokeDao *RevokeDao) Insert(revoke *Revoke) (int64, error)

Jump to

Keyboard shortcuts

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