example

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyService

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

MyService is an example mock service to work as demonstration support for Biff library.

func NewMyService

func NewMyService() *MyService

NewMyService will instantiate a new `MyService`

func (*MyService) Login

func (m *MyService) Login(email, password string) *User

Login will find a user by email, check password and put in session. If all the process is right, logged user will be returned, otherwise nil.

func (*MyService) RegisterUser

func (m *MyService) RegisterUser(email, password string) *User

RegisterUser will register a new user with a password. If user already exists a nil value will be returned.

func (*MyService) RetrieveUser

func (m *MyService) RetrieveUser(email string) *User

RetrieveUser will find a user by email. If user do not exist, nil will be returned.

func (*MyService) WriteComment

func (m *MyService) WriteComment(comment string) *string

WriteComment add a comment to the system. User should be logged in.

type User

type User struct {

	// Email is the user email address without restrictions
	Email string

	// Password is the user clear password
	Password string
}

User represents a mock user for `MyService`

Jump to

Keyboard shortcuts

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