transformer

package
v0.0.0-...-1f40b3c Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponsePermission

type ResponsePermission struct {
	Key         string `json:"key"`
	Description string `json:"description"`
}

ResponsePermission response friendly version of db.Permission

func TransformPermission

func TransformPermission(permission db.Permission) ResponsePermission

TransformPermission takes db data and returns response friendly data

func TransformPermissions

func TransformPermissions(items []db.Permission) []ResponsePermission

TransformPermissions takes slice of db data and returns response friendly data

type ResponseRefreshToken

type ResponseRefreshToken struct {
	Token string `json:"token"`
	User  string `json:"user"`
}

ResponseRefreshToken is response friendly db.RefreshToken

func TransformRefreshToken

func TransformRefreshToken(item db.RefreshToken) ResponseRefreshToken

TransformRefreshToken takes db data and returns response friendly data

func TransformRefreshTokens

func TransformRefreshTokens(items []db.RefreshToken) []ResponseRefreshToken

TransformRefreshTokens takes slice of db data and returns response friendly data

type ResponseUser

type ResponseUser struct {
	ID          bson.ObjectId `json:"id"`
	Email       string        `json:"email"`
	Permissions []string      `json:"permissions"`
}

ResponseUser response friendly version of db.User

func TransformUser

func TransformUser(user db.User) ResponseUser

TransformUser takes db data and returns response friendly data

func TransformUsers

func TransformUsers(items []db.User) []ResponseUser

TransformUsers takes slice of db data and returns response friendly data

Jump to

Keyboard shortcuts

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