services

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package services для подключения сервисов и устроения взаимодействия сервисов с главным потоком

Index

Constants

View Source
const PATH_FLAG = "-path"

PATH_FLAG - сиситемая константа - флаг пути к файлам конфигурации.

View Source
const STATUS_ERROR = "error"

STATUS_ERROR - стстус Сервиса - "Ошибка"

View Source
const STATUS_PREPARING = "preparing data"

STATUS_PREPARING - стстус Сервиса - "Подготовка сервиса"

View Source
const STATUS_READY = "ready"

STATUS_READY - стстус Сервиса - "Готово"

View Source
const TYPE_HTML = "text/html"

TYPE_HTML - тип отправляемого сообщения - "HTML"

View Source
const TYPE_PLAIN_TEXT = "text/plain"

TYPE_PLAIN_TEXT - тип отправляемого сообщения - "Текст"

Variables

This section is empty.

Functions

func AddService

func AddService(name string, pService IService)

AddService adding new service with {name} to services list

func Close

func Close(name string, out chan<- interface{}) error

Close service {name}

func Connect

func Connect(name string, in <-chan interface{}) (out chan interface{}, err error)

Connect to service {name} from channel in & return channel service

func ExamlpeSendEmail

func ExamlpeSendEmail()

ExamlpeSendEmail - пример отправки сообщения

func Get

func Get(name string, messages ...interface{}) (response interface{}, err error)

Get messages to service {name} & return result

func InitServices

func InitServices() *rootServices

InitServices started all services from sServices.services in some goroutins

func Send

func Send(name string, messages ...interface{}) (err error)

Send messages to service {name}

func Status

func Status(name string) string

Status service {name} return

func VerifyMail

func VerifyMail(email, password string)

VerifyMail - проверка на валидность email - адреса

Types

type ErrBrokenConnection

type ErrBrokenConnection struct {
	Name  string
	Param interface{}
}

ErrBrokenConnection for errors broken connection

func (ErrBrokenConnection) Error

func (err ErrBrokenConnection) Error() string

type ErrServiceNotCorrectOperation

type ErrServiceNotCorrectOperation struct {
	Name     string
	OperName string
	Message  string
}

ErrServiceNotCorrectOperation for errors if input operation is not valid

func (ErrServiceNotCorrectOperation) Error

type ErrServiceNotCorrectParamType

type ErrServiceNotCorrectParamType struct {
	Name   string
	Number int
	Param  interface{}
}

ErrServiceNotCorrectParamType for errors if parameter is not valid

func (ErrServiceNotCorrectParamType) Error

type ErrServiceNotEnoughParameter

type ErrServiceNotEnoughParameter struct {
	Name  string
	Param interface{}
}

ErrServiceNotEnoughParameter for errors if not found required parameter

func (ErrServiceNotEnoughParameter) Error

type ErrServiceNotFound

type ErrServiceNotFound struct {
	Name string
}

ErrServiceNotFound for errors when current service not found

func (ErrServiceNotFound) Error

func (err ErrServiceNotFound) Error() string

type ErrServiceNotReady

type ErrServiceNotReady struct {
	Name string
}

ErrServiceNotReady for errors if service not ready

func (ErrServiceNotReady) Error

func (err ErrServiceNotReady) Error() string

type ErrServiceWrongIndex

type ErrServiceWrongIndex struct {
	Name  string
	Index int
}

ErrServiceWrongIndex for errors wrong index in array range TODO: wrote correct comment for this type

func (ErrServiceWrongIndex) Error

func (err ErrServiceWrongIndex) Error() string

type IService

type IService interface {
	Init() error
	Send(messages ...interface{}) error
	Get(messages ...interface{}) (response interface{}, err error)
	Connect(in <-chan interface{}) (out chan interface{}, err error)
	Close(out chan<- interface{}) error
	Status() string
}

IService интерфейс сервиса

type Mail

type Mail struct {
	From        string
	To          string
	Subject     string
	ContentType string
	Body        string
	Attachments []string
}

Mail - тип данных для письма

Directories

Path Synopsis
Package crmPermission Реализует работу с правами пользователя для доступа в CRM/Extranet
Package crmPermission Реализует работу с правами пользователя для доступа в CRM/Extranet
Package moderation Реализует работу с записями для последуйщей модерации
Package moderation Реализует работу с записями для последуйщей модерации
Package mongod Реализует работу с базой данных mongodb
Package mongod Реализует работу с базой данных mongodb

Jump to

Keyboard shortcuts

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