database

package
v0.0.0-...-c955285 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SessionTable = "sessions"

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func NewDatabase

func NewDatabase(path string) (*Database, error)

func (*Database) CreateSession

func (d *Database) CreateSession(sid string, phishlet string, landing_url string, useragent string, remote_addr string) error

func (*Database) DeleteSession

func (d *Database) DeleteSession(sid string) error

func (*Database) DeleteSessionById

func (d *Database) DeleteSessionById(id int) error

func (*Database) Flush

func (d *Database) Flush()

func (*Database) ListSessions

func (d *Database) ListSessions() ([]*Session, error)

func (*Database) SetSessionCustom

func (d *Database) SetSessionCustom(sid string, name string, value string) error

func (*Database) SetSessionPassword

func (d *Database) SetSessionPassword(sid string, password string) error

func (*Database) SetSessionTokens

func (d *Database) SetSessionTokens(sid string, tokens map[string]map[string]*Token) error

func (*Database) SetSessionUsername

func (d *Database) SetSessionUsername(sid string, username string) error

type Session

type Session struct {
	Id         int                          `json:"id"`
	Phishlet   string                       `json:"phishlet"`
	LandingURL string                       `json:"landing_url"`
	Username   string                       `json:"username"`
	Password   string                       `json:"password"`
	Custom     map[string]string            `json:"custom"`
	Tokens     map[string]map[string]*Token `json:"tokens"`
	SessionId  string                       `json:"session_id"`
	UserAgent  string                       `json:"useragent"`
	RemoteAddr string                       `json:"remote_addr"`
	CreateTime int64                        `json:"create_time"`
	UpdateTime int64                        `json:"update_time"`
}

type Token

type Token struct {
	Name     string
	Value    string
	Path     string
	HttpOnly bool
}

Jump to

Keyboard shortcuts

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