qrcode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Qrcode

type Qrcode struct {
	Id       int
	Target   string
	Password string
}

type QrcodeHandler

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

func NewQrcodeHandler

func NewQrcodeHandler(store QrcodeStore, tmpl *template.Template) *QrcodeHandler

func (*QrcodeHandler) Create

func (h *QrcodeHandler) Create(w http.ResponseWriter, r *http.Request)

func (*QrcodeHandler) Manage

func (h *QrcodeHandler) Manage(w http.ResponseWriter, r *http.Request)

func (*QrcodeHandler) Redirect

func (h *QrcodeHandler) Redirect(w http.ResponseWriter, r *http.Request)

func (*QrcodeHandler) Store

func (h *QrcodeHandler) Store(w http.ResponseWriter, r *http.Request)

func (*QrcodeHandler) Update

func (h *QrcodeHandler) Update(w http.ResponseWriter, r *http.Request)

type QrcodeStore

type QrcodeStore interface {
	NewQrcode(ctx context.Context, password string, target string) error
	GetQrcode(ctx context.Context, id int) (Qrcode, error)
	GetQrcodeByPassword(ctx context.Context, password string) (Qrcode, error)
	UpdateTargetUrl(ctx context.Context, id int, newTargetUrl string) error
	Close() error
}

type SqliteQrcodeStore

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

func NewSqliteQrcodeStore

func NewSqliteQrcodeStore(path string) (*SqliteQrcodeStore, error)

func (*SqliteQrcodeStore) Close

func (s *SqliteQrcodeStore) Close() error

func (*SqliteQrcodeStore) GetQrcode

func (s *SqliteQrcodeStore) GetQrcode(ctx context.Context, id int) (Qrcode, error)

func (*SqliteQrcodeStore) GetQrcodeByPassword

func (s *SqliteQrcodeStore) GetQrcodeByPassword(ctx context.Context, password string) (Qrcode, error)

func (*SqliteQrcodeStore) NewQrcode

func (s *SqliteQrcodeStore) NewQrcode(ctx context.Context, password string, target string) (err error)

func (*SqliteQrcodeStore) UpdateTargetUrl

func (s *SqliteQrcodeStore) UpdateTargetUrl(ctx context.Context, id int, newTargetUrl string) error

Jump to

Keyboard shortcuts

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