core

package
v0.0.0-...-ec5e93e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

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

func NewCore

func NewCore() *Core

func (*Core) AuthenticationLog

func (c *Core) AuthenticationLog(username, authMethod, remoteAddr string)

func (*Core) CancelConfirmByRequestInfo

func (c *Core) CancelConfirmByRequestInfo(ticketId string) error

func (*Core) CheckConfirmStatusByRequestInfo

func (c *Core) CheckConfirmStatusByRequestInfo(ticketId string) (model.TicketState, error)

func (*Core) CheckIfNeedAssetLoginConfirm

func (c *Core) CheckIfNeedAssetLoginConfirm(userId, username, assetId, assetName,
	sysUsername string) (res model.AssetLoginTicketInfo, err error)

func (*Core) Close

func (c *Core) Close()

func (*Core) CreateSession

func (c *Core) CreateSession(session model.Session) error

func (*Core) GenOTPassword

func (c *Core) GenOTPassword(name string) string

func (*Core) GetAllUserPermsAssets

func (c *Core) GetAllUserPermsAssets(nodeIDs []string) ([]map[string]interface{}, model.NodeList, error)

func (*Core) GetAssetById

func (c *Core) GetAssetById(assetID string) (model.Asset, error)

func (*Core) GetAssetByName

func (c *Core) GetAssetByName(name string) (model.Asset, error)

func (*Core) GetSystemUsersByUserIdAndAssetId

func (c *Core) GetSystemUsersByUserIdAndAssetId(userID string, assetID string) (sysUsers []model.SystemUser, err error)

func (*Core) GetTerminalConfig

func (c *Core) GetTerminalConfig() (model.TerminalConfig, error)

func (*Core) GetUser

func (c *Core) GetUser(name string) (model.User, error)

func (*Core) InsertLog

func (c *Core) InsertLog(tp, user, msg string)

func (*Core) InteractiveLog

func (c *Core) InteractiveLog(user string)

func (*Core) LimitTryLogin

func (c *Core) LimitTryLogin(user string)

func (*Core) QueryAllAsset

func (c *Core) QueryAllAsset() ([]string, error)

func (*Core) QueryAllNode

func (c *Core) QueryAllNode() ([]string, error)

func (*Core) QueryAllSystemUser

func (c *Core) QueryAllSystemUser() ([]string, error)

func (*Core) QueryAllUser

func (c *Core) QueryAllUser() ([]string, error)

func (*Core) QueryAllUserSecret

func (c *Core) QueryAllUserSecret() ([]string, error)

func (*Core) QueryAssetUserExpire

func (c *Core) QueryAssetUserExpire(userID string, assetID string) (*model.ExpireInfo,
	error)

func (*Core) QueryAssetUserInfo

func (c *Core) QueryAssetUserInfo() ([]string, error)

func (*Core) QueryAssetUserVscodePerm

func (c *Core) QueryAssetUserVscodePerm(userID string, assetID string) (bool, error)

func (*Core) QueryDirectLoginInfo

func (c *Core) QueryDirectLoginInfo(userID string, directLogin map[string]string) (asset model.Asset,
	sysUser model.SystemUser, err error)

func (*Core) QueryLoginTicket

func (c *Core) QueryLoginTicket() ([]string, error)

func (*Core) QueryPengdingLoginTicket

func (c *Core) QueryPengdingLoginTicket() ([]string, error)

func (*Core) QueryUserLog

func (c *Core) QueryUserLog() ([]string, error)

func (*Core) SessionDisconnect

func (c *Core) SessionDisconnect(id string) error

func (*Core) SessionFailed

func (c *Core) SessionFailed(id string, cause error) error

func (*Core) SessionSuccess

func (c *Core) SessionSuccess(id string) error

func (*Core) UpdateTicketState

func (c *Core) UpdateTicketState(ticketId string, state string, user string) error

func (*Core) UserAuthenticate

func (c *Core) UserAuthenticate(username string, pass string, pubKey string) (model.User, bool)

func (*Core) UserIsBlocked

func (c *Core) UserIsBlocked(user string) bool

type DB

type DB interface {
	Close() error
	GetTerminalConfig() (model.TerminalConfig, error)
	QueryStruct(st interface{}, sql string, cond ...interface{}) error
	QueryStructs(mod int, sql string, cond ...interface{}) (interface{}, error)
	QueryOneField(f interface{}, sql string, cond ...interface{}) error
	QueryTwoField(f1 interface{}, f2 interface{}, sql string, cond ...interface{}) error
	QueryOneFieldMutilRows(sql string, cond ...interface{}) ([]string, error)
	InsertData(sql string, data ...interface{}) error
	UpdateData(sql string, args ...interface{}) error
}

func NewGenji

func NewGenji(path string) (DB, error)

type Genji

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

func (*Genji) Close

func (g *Genji) Close() error

func (*Genji) GetTerminalConfig

func (g *Genji) GetTerminalConfig() (model.TerminalConfig, error)

func (*Genji) InsertData

func (g *Genji) InsertData(sql string, data ...interface{}) error

func (*Genji) QueryOneField

func (g *Genji) QueryOneField(f interface{}, sql string, cond ...interface{}) error

func (*Genji) QueryOneFieldMutilRows

func (g *Genji) QueryOneFieldMutilRows(sql string, cond ...interface{}) ([]string, error)

func (*Genji) QueryStruct

func (g *Genji) QueryStruct(st interface{}, sql string, cond ...interface{}) error

func (*Genji) QueryStructs

func (g *Genji) QueryStructs(mod int, sql string, cond ...interface{}) (interface{}, error)

func (*Genji) QueryTwoField

func (g *Genji) QueryTwoField(f1 interface{}, f2 interface{}, sql string, cond ...interface{}) error

func (*Genji) UpdateData

func (g *Genji) UpdateData(sql string, args ...interface{}) error

Jump to

Keyboard shortcuts

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