admin

package
v0.0.0-...-d370aa6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2016 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mailer

func Mailer(m *mailer.App) func(srv *Service) error

Mailer sets mailer

Types

type RowCount

type RowCount int64

RowCount - количество строк в выборке

type Service

type Service struct {
	Log      *log.Logger
	DB       *database.DB
	Template *template.Template
	Mailer   *mailer.App

	Field   string // Context field for Sessiondata
	IPField string // `long:"logger_realip_field" default:"real-ip" description:"Context field for Real ip"`
}

Service holds service attributes

func New

func New(logger *log.Logger, db *database.DB, field, ipfield string, options ...func(srv *Service) error) (srv *Service, err error)

New - Конструктор сервера API

func (*Service) UserList

func (srv *Service) UserList(r *http.Request, args *UserListArgs, result *account.Records) error

UserList - get user list

func (*Service) UserListCount

func (srv *Service) UserListCount(r *http.Request, args *UserListArgs, result *RowCount) error

UserListCount - выборка строк из журнала

func (*Service) UserSave

func (srv *Service) UserSave(r *http.Request, args *UserSaveArgs, result *int64) error

UserSave - add new user

type TemplateVars

type TemplateVars struct {
	User         account.Record
	Scheme, Host string
	Meta         map[string]string
	Data         interface{}
}

TemplateVars holds template variables

func (*TemplateVars) SetMeta

func (tv *TemplateVars) SetMeta(key string, values ...string) string

SetMeta used inside templates for metadata setting (like setting email subject)

type UserListArgs

type UserListArgs struct {
	Offset, By, Page int
	Email            string
}

UserListArgs - аргументы метода UserList

type UserSaveArgs

type UserSaveArgs struct {
	ID                              int64
	Notify, Disabled                bool // send email to user
	Login, Name, Email, Group, Data string
}

UserSaveArgs - аргументы метода UserSave

Jump to

Keyboard shortcuts

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