megaplan

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 16 Imported by: 0

README

megaplan

Смотри примеры в examples

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API - Структура объекта API v1

func APIWithConfig

func APIWithConfig(file io.ReadSeeker) *API

APIWithConfig - инициализация экземпляра из файла конфигурации

func (*API) CheckUser

func (api *API) CheckUser(userSign string) (UserAppVerification, error)

CheckUser - проверка пользователя для встроенного приложения

func (*API) GET

func (api *API) GET(uri string, payload map[string]interface{}) *ResponseBuffer

GET - get запрос к API

func (*API) GetToken

func (api *API) GetToken(domain, login, password string) error

GetToken - Получение токена API

func (*API) POST

func (api *API) POST(uri string, payload map[string]interface{}) *ResponseBuffer

POST - post запрос на API

func (*API) ReadConfig

func (api *API) ReadConfig(file io.ReadSeeker)

ReadConfig - Сразу инициализирует API с указанием пути к файлу-конфигу

type Comment

type Comment struct {
	ID          uint         `json:"ID"`
	Text        string       `json:"Text"`
	Work        uint         `json:"Work"`
	WorkDate    string       `json:"WorkDate"`
	TimeCreated string       `json:"TimeCreated"`
	Author      EmployeeCard `json:"Author"`
}

Comment - комментарий

type CommentsList

type CommentsList []Comment

CommentsList - список комментариев

type Config

type Config struct {
	Megaplan struct {
		AccessID  string `yaml:"access_id"`
		SecretKey string `yaml:"secret_key"`
		Login     string `yaml:"login"`
		Password  string `yaml:"password"`
		Domain    string `yaml:"domain"`
		AppUUID   string `yaml:"appUUID"`
		AppSecret string `yaml:"appSecret"`
	} `yaml:"megaplan"`
}

Config - формат конфига для API мегаплан

func (*Config) ReadConfig

func (c *Config) ReadConfig(file io.ReadSeeker)

ReadConfig - парсинг файла по указанному пути, создание конфига

type EmployeeCard

type EmployeeCard struct {
	ID         uint   `json:"Id"`
	FirstName  string `json:"FirstName"`
	MiddleName string `json:"MiddleName"`
	LastName   string `json:"LastName"`
	Department struct {
		ID   uint   `json:"Id"`
		Name string `json:"Name"`
	} `json:"Department"`
	Position struct {
		ID   uint   `json:"Id"`
		Name string `json:"Name"`
	} `json:"Position"`
	Login     string `json:"Login"`
	Email     string `json:"Email"`
	FireDay   string `json:"FireDay"`
	Behaviour string `json:"Behaviour"`
}

EmployeeCard - Карточка сотрудника

type EmployeeList

type EmployeeList []EmployeeCard

EmployeeList - Список сотрудников

type ResponseBuffer

type ResponseBuffer struct {
	bytes.Buffer
}

ResponseBuffer - ответ от API

func (*ResponseBuffer) Scan

func (rb *ResponseBuffer) Scan(i interface{}) error

Scan - парсинг структуры

type Tag

type Tag struct {
	ID   uint   `json:"Id"`
	Name string `json:"Name"`
}

Tag - метка

type TagsList

type TagsList []Tag

TagsList - Список меток

type TaskCard

type TaskCard struct {
	ID       uint   `json:"Id"`
	Name     string `json:"Name"`
	Status   string `json:"Status"`
	Deadline string `json:"Deadline"`
	Owner    struct {
		ID   string `json:"Id"`
		Name string `json:"Name"`
	} `json:"Owner"`
	Responsible struct {
		ID   string `json:"Id"`
		Name string `json:"Name"`
	} `json:"Responsible"`
	TimeCreated string `json:"TimeCreated"`
	TimeUpdated string `json:"TimeUpdated"`
	Finish      string `json:"Finish"`
	Tags        []Tag  `json:"Tags"`
	Statement   string `json:"Statement"`
	Auditors    []struct {
		ID   string `json:"Id"`
		Name string `json:"Name"`
	} `json:"Auditors"`
	PlannedWork            string `json:"PlannedWork"`
	PlannedFinish          string `json:"PlannedFinish"`
	ActualWork             string `json:"ActualWork"`
	ActualWorkWithSubTasks string `json:"ActualWorkWithSubTasks"`
	IsOverdue              bool   `json:"IsOverdue"`
}

TaskCard - Карточка задачи

type TaskList

type TaskList []TaskCard

TaskList - Список задач

type UserAppVerification

type UserAppVerification struct {
	UserID   string `json:"id"`
	FullName string `json:"name"`
	Position string `json:"position"`
}

UserAppVerification - структура ответа при валидации пользователя во встроенного приложения

type UserVerifyResponse

type UserVerifyResponse struct {
	Data UserAppVerification `json:"data"`
	// contains filtered or unexported fields
}

UserVerifyResponse - тип для верификации юзеров во встроенном приложении

func (*UserVerifyResponse) IFerror

func (r *UserVerifyResponse) IFerror() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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