auth

package
v0.0.0-...-4606e03 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(route *gin.Engine, service Service)

Routes in the domain route

Types

type Auth

type Auth struct {
}

Auth domain entity

type Repository

type Repository interface {
}

Repository for auth domain

type Service

type Service interface {
	GetAllRole()
	GetAllResource()
	GetAllDomain()
	Authorize(user, domain, resource string) (bool, error)
	CheckUser(username, password string) (*User, error)
	CreateToken(user *User) (string, error)
}

Service is the auth service

func NewService

func NewService(authRepo Repository, ra *redisadapter.Adapter) (Service, error)

NewService creates new auth service

type User

type User struct {
	ID string
}

User entity

Jump to

Keyboard shortcuts

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