doubles

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MemUser1 = gotuna.InMemoryUser{
	ID:       "123",
	Email:    "john@example.com",
	Name:     "John",
	Password: "pass123",
}

MemUser1 is a sample in-memory user.

View Source
var MemUser2 = gotuna.InMemoryUser{
	ID:       "456",
	Email:    "bob@example.com",
	Name:     "Bob",
	Password: "bobby5",
}

MemUser2 is a sample in-memory user.

Functions

func NewStubTemplatingEngine

func NewStubTemplatingEngine(template string) gotuna.TemplatingEngine

NewStubTemplatingEngine returns new native HTML engine with a stub template

func NewUserRepositoryStub

func NewUserRepositoryStub() gotuna.UserRepository

NewUserRepositoryStub returns a new user repository with two sample users. This is a sample UserRepository implementation with users stored in-memory.

Types

type FilesystemStub

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

FilesystemStub implements type FS interface

func NewFileSystemStub

func NewFileSystemStub(files map[string][]byte) *FilesystemStub

NewFileSystemStub returns a new fs.FS stub with provided files.

func (*FilesystemStub) Open

func (f *FilesystemStub) Open(name string) (fs.File, error)

Open opens the named file

type StoreSpy

type StoreSpy struct {
	Session   *sessions.Session
	GetCalls  int
	NewCalls  int
	SaveCalls int
}

StoreSpy implements gorilla.Store interface

func NewGorillaSessionStoreSpy

func NewGorillaSessionStoreSpy(userID string) *StoreSpy

NewGorillaSessionStoreSpy return a new gorilla.Store spy

func (*StoreSpy) Get

func (spy *StoreSpy) Get(r *http.Request, name string) (*sessions.Session, error)

Get counts the Get calls

func (*StoreSpy) New

func (spy *StoreSpy) New(r *http.Request, name string) (*sessions.Session, error)

New counts the New calls

func (*StoreSpy) Save

Save counts the Save calls

Jump to

Keyboard shortcuts

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