Documentation ¶
Index ¶
- Variables
- type Sqlite
- func (s *Sqlite) CreateAlias(alias models.Alias) (models.Alias, error)
- func (s *Sqlite) CreateExecution(execution models.Execution, payloadIDOrAlias string) (models.Execution, error)
- func (s *Sqlite) CreateInjection(injection models.Injection) (models.Injection, error)
- func (s *Sqlite) CreateLoot(loot models.Loot) (models.Loot, error)
- func (s *Sqlite) CreateOTP(user models.User, TOTPSecret string) (models.User, error)
- func (s *Sqlite) CreatePayload(payload models.Payload) (models.Payload, error)
- func (s *Sqlite) CreateUser(user models.User) (models.User, error)
- func (s *Sqlite) DeleteAlias(a models.Alias) error
- func (s *Sqlite) DeleteExecution(e models.Execution) error
- func (s *Sqlite) DeleteInjection(i models.Injection) error
- func (s *Sqlite) DeleteLoot(c models.Loot) error
- func (s *Sqlite) DeletePayload(p models.Payload) error
- func (s *Sqlite) DeleteUser(u models.User) error
- func (s *Sqlite) GetAlias(alias string) (models.Alias, error)
- func (s *Sqlite) GetAliasByID(id string) (models.Alias, error)
- func (s *Sqlite) GetAliasByPayloadID(id string) (models.Alias, error)
- func (s *Sqlite) GetAliases() ([]models.Alias, error)
- func (s *Sqlite) GetExecution(id string) (models.Execution, error)
- func (s *Sqlite) GetExecutions() ([]models.Execution, error)
- func (s *Sqlite) GetInjection(id string) (models.Injection, error)
- func (s *Sqlite) GetInjectionByName(name string) (models.Injection, error)
- func (s *Sqlite) GetInjections() ([]models.Injection, error)
- func (s *Sqlite) GetLoot(id string) (models.Loot, error)
- func (s *Sqlite) GetLoots() ([]models.Loot, error)
- func (s *Sqlite) GetPayload(id string) (models.Payload, error)
- func (s *Sqlite) GetPayloadByAlias(short string) (models.Payload, error)
- func (s *Sqlite) GetPayloads() ([]models.Payload, error)
- func (s *Sqlite) GetUser(id string) (models.User, error)
- func (s *Sqlite) GetUserByName(name string) (models.User, error)
- func (s *Sqlite) Init() error
- func (s *Sqlite) RemoveOTP(user models.User) (models.User, error)
- func (s *Sqlite) Setup() error
- func (s *Sqlite) UpdatePayload(models.Payload) error
- func (s *Sqlite) UpdateUser(models.User) error
Constants ¶
This section is empty.
Variables ¶
var CREATE_TABLE_ALIASES = `` /* 295-byte string literal not displayed */
var CREATE_TABLE_EXECUTIONS = `` /* 288-byte string literal not displayed */
var CREATE_TABLE_INJECTIONS = `` /* 248-byte string literal not displayed */
var CREATE_TABLE_LOOTS = `` /* 147-byte string literal not displayed */
var CREATE_TABLE_PAYLOADS = `` /* 294-byte string literal not displayed */
var CREATE_TABLE_USERS = `` /* 301-byte string literal not displayed */
var DELETE_ALIAS = `DELETE FROM aliases WHERE id = ?;`
var DELETE_EXECUTION = `DELETE FROM executions WHERE id = ?;`
var DELETE_INJECTION = `DELETE FROM injections WHERE id = ?;`
var DELETE_LOOT = `DELETE FROM loots WHERE id = ?;`
var DELETE_PAYLOAD = `DELETE FROM payloads WHERE id = ?;`
DELETE
var DELETE_USER = `DELETE FROM users WHERE id = ?;`
var INSERT_ALIAS = `INSERT INTO aliases (id, payload_id, alias) VALUES (?, ?, ?);`
var INSERT_EXECUTION = `INSERT INTO executions (id, payload_id, alias_id) VALUES (?, ?, ?);`
var INSERT_INJECTION = `INSERT INTO injections (id, name, content) VALUES (?, ?, ?);`
var INSERT_LOOT = `INSERT INTO loots (id, data) VALUES (?, ?);`
var INSERT_PAYLOAD = `INSERT INTO payloads (id, name, hash, content, content_type) VALUES (?, ?, ?, ?, ?);`
INSERT
var INSERT_USER = `INSERT INTO users (id, username, password) VALUES (?, ?, ?);`
var SELECT_ALIAS_BY_ID = `
SELECT *
FROM aliases
WHERE id = ?;
`
var SELECT_ALIAS_BY_PAYLOAD_ID = `` /* 185-byte string literal not displayed */
var SELECT_ALIAS_BY_SHORTNAME = `
SELECT *
FROM aliases
WHERE alias = ?;
`
var SELECT_ALL_ALIASES = `
SELECT id, payload_id, alias, created_at, modified_at
FROM aliases;
`
var SELECT_ALL_EXECUTIONS = `
SELECT id, payload_id, alias_id, triggered_at
FROM executions;
`
var SELECT_ALL_INJECTION = `
SELECT id, name, content, created_at, modified_at
FROM injections;
`
var SELECT_ALL_LOOT = `
SELECT id, data, created_at
FROM loots;
`
var SELECT_ALL_PAYLOADS = `` /* 149-byte string literal not displayed */
var SELECT_EXECUTION = `
SELECT id, payload_id, alias_id, triggered_at
FROM executions
WHERE id = ?;
`
var SELECT_INJECTION = `
SELECT id, name, content, created_at, modified_at
FROM injections
WHERE id = ?;
`
var SELECT_INJECTION_BY_NAME = `
SELECT id, name, content, created_at, modified_at
FROM injections
WHERE name = ?;
`
var SELECT_LOOT = `
SELECT id, data, created_at
FROM loots
WHERE id = ?;
`
var SELECT_PAYLOAD_BY_ALIAS = `` /* 211-byte string literal not displayed */
var SELECT_PAYLOAD_BY_ID = `
SELECT id, name, hash, content, content_type, created_at, modified_at
FROM payloads
WHERE id = ?;
`
var SELECT_PAYLOAD_BY_NAME = `
SELECT id, name, hash, content, content_type, created_at, modified_at
FROM payloads
WHERE name = ?;
`
var SELECT_USER = `
SELECT id, username, password, two_factor_enabled, totp_secret, created_at, modified_at
FROM users
WHERE id = ?;
`
var SELECT_USER_BY_NAME = `
SELECT id, username, password, two_factor_enabled, totp_secret, created_at, modified_at
FROM users
WHERE username = ?;
`
var UPDATE_ADD_TOTP = `
UPDATE users
SET two_factor_enabled = ?,
totp_secret = ?
WHERE id = ?;`
UPDATE
Functions ¶
This section is empty.
Types ¶
type Sqlite ¶
type Sqlite struct {
// contains filtered or unexported fields
}
Sqlite struct represent the base Sqlite object It implements the storage.Storage interface
func (*Sqlite) CreateAlias ¶
CreateAlias create an alias token based on models.Alias It also returns it if sucessfuly stored
func (*Sqlite) CreateExecution ¶
func (s *Sqlite) CreateExecution(execution models.Execution, payloadIDOrAlias string) (models.Execution, error)
CreateExecution create an execution token based on models.Execution It also returns it if sucessfuly stored
func (*Sqlite) CreateInjection ¶
CreateInjection create an injection token based on models.Injection It also returns it if sucessfuly stored
func (*Sqlite) CreateLoot ¶
CreateLoot create a loot token based on models.Loot It also returns it if sucessfuly stored
func (*Sqlite) CreatePayload ¶
CreatePayload create a payload based on models.Payload It also returns it if sucessfuly stored
func (*Sqlite) CreateUser ¶
CreateUser create a user based on models.User It also returns it if sucessfuly stored
func (*Sqlite) DeleteAlias ¶
DeleteAlias delete the provided Alias from the database
func (*Sqlite) DeleteExecution ¶
DeleteExecution delete the provided Execution from the database
func (*Sqlite) DeleteInjection ¶
DeleteInjection delete the provided Injection from the database
func (*Sqlite) DeleteLoot ¶
DeleteLoot delete the provided Loot from the database
func (*Sqlite) DeletePayload ¶
DeletePayload delete the provided payload from the database
func (*Sqlite) DeleteUser ¶
DeleteUser delete the provided User from the database
func (*Sqlite) GetAliasByID ¶
GetAliasByID returns the selected alias by its ID
func (*Sqlite) GetAliasByPayloadID ¶
GetAliasByPayloadID returns the selected alias by its payloadID
func (*Sqlite) GetAliases ¶
GetAliases returns all the Aliases from the database
func (*Sqlite) GetExecution ¶
GetExecution returns the execution selected by its ID
func (*Sqlite) GetExecutions ¶
GetExecutions returns all the executions from the database
func (*Sqlite) GetInjection ¶
GetInjection returns the select Injection based on its ID
func (*Sqlite) GetInjectionByName ¶
GetInjectionByName returns the select Injection based on its name
func (*Sqlite) GetInjections ¶
GetInjections returns all injection from the database
func (*Sqlite) GetPayload ¶
GetPayload returns the select payload based on its ID
func (*Sqlite) GetPayloadByAlias ¶
GetPayloadByAlias returns the select payload based on its alias
func (*Sqlite) GetPayloads ¶
GetPayloads returns all the payloads stored in the database
func (*Sqlite) GetUserByName ¶
GetUserByName return an user by its name
func (*Sqlite) UpdatePayload ¶
UpdatePayload Not Implemented Yet Update the payload based on the provided one. Only the ID field must be correct. All other field will be changed