controllers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FieldNotValid ...
	FieldNotValid = "field_not_valid"
	// FieldNotBlank ...
	FieldNotBlank = "field_not_blank"
	// FieldSizeMax ...
	FieldSizeMax = "field_size_max"
	// FieldSizeMin ...
	FieldSizeMin = "field_size_min"
	// FieldInvalidLength ...
	FieldInvalidLength = "field_invalid_length"
	// FieldNotValidChars ...
	FieldNotValidChars = "field_not_valid_chars"
	// FieldMax ...
	FieldMax = "field_max"
	// FieldMin ...
	FieldMin = "field_min"
	// FieldFuture ...
	FieldFuture = "field_future"
	// FieldPast ...
	FieldPast = "field_past"
	// FieldEmail ...
	FieldEmail = "field_email"
	// FieldCardNumber ...
	FieldCardNumber = "field_card_number"
	// FieldPhone ...
	FieldPhone = "field_phone"
	// FieldDuplicate ...
	FieldDuplicate = "field_duplicate"
	// FieldIp ...
	FieldIp = "field_ip"
	// FieldRange ...
	FieldRange = "field_range"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerAuth

type ControllerAuth struct {
	*ControllerCommon
}

ControllerAuth ...

func NewControllerAuth

func NewControllerAuth(common *ControllerCommon) *ControllerAuth

NewControllerAuth ...

func (ControllerAuth) AccessList

func (c ControllerAuth) AccessList(ctx *gin.Context)

swagger:operation GET /access_list authGetAccessList --- summary: get user access list description: security: - ApiKeyAuth: [] tags: - auth responses:

  "200":
    description: OK
    schema:
      type: object
      properties:
        access_list:
          $ref: '#/definitions/AccessList'
  "401":
    description: "Unauthorized"
  "403":
    description: "Forbidden"
  "500":
	   $ref: '#/responses/Error'

func (ControllerAuth) Recovery

func (c ControllerAuth) Recovery(ctx *gin.Context)

swagger:operation POST /recovery authRecovery --- summary: recovery access description: tags: - auth responses:

  "200":
	   $ref: '#/responses/Success'
  "500":
	   $ref: '#/responses/Error'

func (ControllerAuth) Reset

func (c ControllerAuth) Reset(ctx *gin.Context)

swagger:operation POST /reset authReset --- summary: reset access description: tags: - auth responses:

  "200":
	   $ref: '#/responses/Success'
  "500":
	   $ref: '#/responses/Error'

func (ControllerAuth) SignIn

func (c ControllerAuth) SignIn(ctx *gin.Context)

swagger:operation POST /signin authSignin --- summary: sign in description: security: - BasicAuth: [] tags: - auth responses:

  "200":
    description: OK
    schema:
      $ref: '#/definitions/AuthSignInResponse'
  "400":
	   $ref: '#/responses/Error'
  "401":
    description: "Unauthorized"
  "403":
    description: "Forbidden"
  "500":
	   $ref: '#/responses/Error'

func (ControllerAuth) SignOut

func (c ControllerAuth) SignOut(ctx *gin.Context)

swagger:operation POST /signout authSignout --- summary: sign out description: security: - ApiKeyAuth: [] tags: - auth responses:

  "200":
	   $ref: '#/responses/Success'
  "401":
    description: "Unauthorized"
  "403":
    description: "Forbidden"
  "500":
	   $ref: '#/responses/Error'

type ControllerCommon

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

ControllerCommon ...

func NewControllerCommon

func NewControllerCommon(adaptors *adaptors.Adaptors,
	core *core.Core,
	accessList *access_list.AccessListService,
	endpoint *endpoint.Endpoint) *ControllerCommon

NewControllerCommon ...

type ControllerMap

type ControllerMap struct {
	*ControllerCommon
}

ControllerMap ...

func NewControllerMap

func NewControllerMap(common *ControllerCommon) *ControllerMap

NewControllerMap ...

func (ControllerMap) GetActiveElements

func (c ControllerMap) GetActiveElements(ctx *gin.Context)

swagger:operation GET /map/active_elements mapGetActiveElements --- summary: get active map elements description: security: - ApiKeyAuth: [] tags: - map parameters:

  • default: 10 description: limit in: query name: limit required: true type: integer
  • default: 0 description: offset in: query name: offset required: true type: integer
  • default: DESC description: order in: query name: order type: string
  • default: id description: sort_by in: query name: sort_by type: string

responses:

  "200":
    description: OK
    schema:
      $ref: '#/responses/MapActiveElementList'
  "400":
	   $ref: '#/responses/Error'
  "401":
    description: "Unauthorized"
  "403":
    description: "Forbidden"
  "500":
	   $ref: '#/responses/Error'

type ControllerMapDevice added in v0.2.0

type ControllerMapDevice struct {
	*ControllerCommon
}

ControllerMapDevice ...

func NewControllerMapDevice added in v0.2.0

func NewControllerMapDevice(common *ControllerCommon) *ControllerMapDevice

NewControllerMapDevice ...

func (*ControllerMapDevice) GetHistory added in v0.2.0

func (c *ControllerMapDevice) GetHistory(ctx *gin.Context)

GetHistory ...

type ControllerWorkflow

type ControllerWorkflow struct {
	*ControllerCommon
}

ControllerWorkflow ...

func NewControllerWorkflow

func NewControllerWorkflow(common *ControllerCommon) *ControllerWorkflow

NewControllerWorkflow ...

func (ControllerWorkflow) GetById

func (c ControllerWorkflow) GetById(ctx *gin.Context)

swagger:operation GET /workflow/{id} workflowGetById --- parameters:

  • description: Workflow ID in: path name: id required: true type: integer

summary: get workflow by id description: security: - ApiKeyAuth: [] tags: - workflow responses:

  "200":
    description: OK
    schema:
      $ref: '#/definitions/Workflow'
  "400":
	   $ref: '#/responses/Error'
  "401":
    description: "Unauthorized"
  "403":
    description: "Forbidden"
  "404":
	   $ref: '#/responses/Error'
  "500":
	   $ref: '#/responses/Error'

func (ControllerWorkflow) GetList

func (c ControllerWorkflow) GetList(ctx *gin.Context)

swagger:operation GET /workflows workflowList --- summary: get workflow list description: security: - ApiKeyAuth: [] tags: - workflow parameters:

  • default: 10 description: limit in: query name: limit required: true type: integer
  • default: 0 description: offset in: query name: offset required: true type: integer
  • default: DESC description: order in: query name: order type: string
  • default: id description: sort_by in: query name: sort_by type: string

responses:

  "200":
	   $ref: '#/responses/WorkflowList'
  "401":
    description: "Unauthorized"
  "403":
    description: "Forbidden"
  "500":
	   $ref: '#/responses/Error'

func (ControllerWorkflow) UpdateScenario added in v0.0.25

func (c ControllerWorkflow) UpdateScenario(ctx *gin.Context)

Workflow godoc swagger:operation PUT /workflow/{id}/update_scenario workflowUpdateScenario --- parameters:

  • description: Workflow ID in: path name: id required: true type: integer
  • description: Update workflow scenario params in: body name: workflowUpdateWorkflowScenario required: true schema: $ref: '#/definitions/WorkflowUpdateWorkflowScenario'

summary: update workflow scenario description: security: - ApiKeyAuth: [] tags: - workflow responses:

  "200":
    $ref: '#/responses/Success'
  "400":
	   $ref: '#/responses/Error'
  "401":
    description: "Unauthorized"
  "403":
    description: "Forbidden"
  "404":
	   $ref: '#/responses/Error'
  "500":
	   $ref: '#/responses/Error'

type Error

type Error struct {
	Payload *models.Error `json:"body,omitempty"`
	// contains filtered or unexported fields
}

Error ...

func NewError

func NewError(code int, msg ...interface{}) *Error

NewPostAuthTokenDefault creates Error with default headers values

func (*Error) AddField

func (o *Error) AddField(code, message, field string) *Error

AddField ...

func (*Error) AddFieldf

func (o *Error) AddFieldf(name, code string, N ...int) *Error

AddFieldf ...

func (*Error) CheckNum

func (o *Error) CheckNum(num interface{}, name string, min, max float64) *Error

CheckNum ...

func (*Error) Error

func (e *Error) Error() string

Error ...

func (*Error) Errors

func (o *Error) Errors() bool

Errors ...

func (*Error) Fields

func (o *Error) Fields() []*models.ErrorErrorsItems

Fields ...

func (*Error) Send

func (e *Error) Send(ctx *gin.Context)

Send ...

func (*Error) SetMessage

func (o *Error) SetMessage(err error) *Error

SetMessage ...

func (*Error) ValidationToErrors

func (e *Error) ValidationToErrors(errs []*validation.Error) *Error

ValidationToErrors ...

type MobileControllersV1

type MobileControllersV1 struct {
	Auth      *ControllerAuth
	Workflow  *ControllerWorkflow
	Map       *ControllerMap
	MapDevice *ControllerMapDevice
}

MobileControllersV1 ...

func NewMobileControllersV1

func NewMobileControllersV1(adaptors *adaptors.Adaptors,
	core *core.Core,
	accessList *access_list.AccessListService,
	command *endpoint.Endpoint) *MobileControllersV1

NewMobileControllersV1 ...

type Response

type Response struct {
	StatusCode int
	Payload    interface{}
}

simple response

func NewSuccess

func NewSuccess() *Response

NewSuccess ...

func (*Response) Item

func (r *Response) Item(name string, item interface{}) *Response

Item ...

func (*Response) Page

func (r *Response) Page(limit, offset int, total int64, items interface{}) *Response

Page ...

func (*Response) Send

func (r *Response) Send(ctx *gin.Context)

Send ...

func (*Response) SetData

func (r *Response) SetData(data interface{}) *Response

SetData ...

func (*Response) Success

func (r *Response) Success() *Response

Success ...

Jump to

Keyboard shortcuts

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