storage

package
v0.0.0-...-bfaa685 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSqliteDB

func NewSqliteDB(file string) (*sql.DB, error)

func SaveTmpDB

func SaveTmpDB(file multipart.File, handler *multipart.FileHeader) (string, error)

func TestSqlConnect

func TestSqlConnect() *sql.DB

Types

type ImportResponse

type ImportResponse struct {
	Err     string
	Message string
}

type Request

type Request struct {
	Date   string
	Url    string
	Method string
}

type Route

type Route struct {
	Id         int
	Url        string
	Method     string
	Headers    map[string]string
	StatusCode int `json:"status_code"`
	Body       string
}

type SQLiteDB

type SQLiteDB struct {
	FilePath string
	// contains filtered or unexported fields
}

func GetDB

func GetDB(db *sql.DB, filePath string) (*SQLiteDB, error)

func (*SQLiteDB) AddRoute

func (s *SQLiteDB) AddRoute(route Route) error

func (*SQLiteDB) Close

func (s *SQLiteDB) Close() error

func (*SQLiteDB) CreateTables

func (s *SQLiteDB) CreateTables() error

func (*SQLiteDB) DeleteRoute

func (s *SQLiteDB) DeleteRoute(route Route) error

func (*SQLiteDB) EditRoute

func (s *SQLiteDB) EditRoute(route Route) error

func (*SQLiteDB) GetRoute

func (s *SQLiteDB) GetRoute(url string, method string) (Route, error)

func (*SQLiteDB) GetRouteById

func (s *SQLiteDB) GetRouteById(id int) (Route, error)

func (*SQLiteDB) GetRoutes

func (s *SQLiteDB) GetRoutes() ([]Route, error)

func (*SQLiteDB) ImportDb

func (s *SQLiteDB) ImportDb(file_path string) error

func (*SQLiteDB) TableExists

func (s *SQLiteDB) TableExists(tableName string) bool

type Setting

type Setting struct {
	Id     int
	Option string
	Value  string
}

Jump to

Keyboard shortcuts

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