Back to godoc.org

Package user

v0.2.7
Latest Go to latest

The highest tagged major version is .

Published: Mar 23, 2020 | License: MPL-2.0 | Module: xorkevin.dev/governor

Index

Constants

const (
	NewUserQueueID    = "gov.user.new"
	DeleteUserQueueID = "gov.user.delete"
)

type DeleteUserProps

type DeleteUserProps struct {
	Userid string `json:"userid"`
}

DeleteUserProps are properties of a deleted user

func DecodeDeleteUserProps

func DecodeDeleteUserProps(msgdata []byte) (*DeleteUserProps, error)

DecodeDeleteUserProps marshals json encoded delete user props into a struct

type NewUserProps

type NewUserProps struct {
	Userid       string `json:"userid"`
	Username     string `json:"username"`
	Email        string `json:"email"`
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	CreationTime int64  `json:"creation_time"`
}

NewUserProps are properties of a newly created user

func DecodeNewUserProps

func DecodeNewUserProps(msgdata []byte) (*NewUserProps, error)

DecodeNewUserProps marshals json encoded new user props into a struct

type ResUserGet

type ResUserGet struct {
	ResUserGetPublic
	Email string `json:"email"`
}

ResUserGet holds all the fields of a user

type ResUserGetPublic

type ResUserGetPublic struct {
	Userid       string `json:"userid"`
	Username     string `json:"username"`
	AuthTags     string `json:"auth_tags"`
	FirstName    string `json:"first_name"`
	LastName     string `json:"last_name"`
	CreationTime int64  `json:"creation_time"`
}

ResUserGetPublic holds the public fields of a user

type Service

type Service interface {
	governor.Service
	User
}

func New

func New(users usermodel.Repo, sessions sessionmodel.Repo, approvals approvalmodel.Repo, roles role.Role, apikeys apikey.Apikey, kv kvstore.KVStore, queue msgqueue.Msgqueue, mailer mail.Mail, tokenizer token.Tokenizer, g gate.Gate) Service

New creates a new User

type User

type User interface {
	GetByID(userid string) (*ResUserGet, error)
}

User is a user management service

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier