service

package
v0.0.0-...-4c9bff6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdentityService

type IdentityService interface {
	// Signin verify user account
	Signin(
		ctx context.Context,
		username string,
		password string,
		opt *SigninOption,
	) (identity *entity.Identity, err error)

	// Signup sign up a new user
	Signup(
		ctx context.Context,
		username string,
		password string,
		opts *SignupOption,
	) (identity *entity.Identity, err error)
}

IdentityService define identity service

type Impl

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

func (*Impl) Signin

func (srv *Impl) Signin(
	ctx context.Context,
	username string,
	password string,
	opt *SigninOption,
) (identity *entity.Identity, err error)

func (*Impl) Signup

func (srv *Impl) Signup(
	ctx context.Context,
	username string,
	password string,
	opt *SignupOption,
) (identity *entity.Identity, err error)

type Middleware

type Middleware func(IdentityService) IdentityService

Middleware describes a service (as opposed to endpoint) middleware.

func LoggingMiddleware

func LoggingMiddleware() Middleware

LoggingMiddleware takes a logger as a dependency and returns a ServiceMiddleware.

type SigninOption

type SigninOption struct {
	IPAddress   string
	Platform    string
	Device      entity.Device
	IdpProvider string
}

type SignupOption

type SignupOption struct {
	Nickname  string        // Nickname user nickname
	FirstName string        // FirstName user first name
	LastName  string        // LastName user last name
	Email     string        // Email user email address
	IPAddress string        // IPAddress from user login
	Platform  string        // Login platform
	Device    entity.Device // Device login information
}

Jump to

Keyboard shortcuts

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