controllers

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerAuth

type ControllerAuth struct {
	*ControllerCommon
}

func NewControllerAuth

func NewControllerAuth(common *ControllerCommon) *ControllerAuth

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
}

func NewControllerCommon

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

type ControllerMap

type ControllerMap struct {
	*ControllerCommon
}

func NewControllerMap

func NewControllerMap(common *ControllerCommon) *ControllerMap

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 ControllerWorkflow

type ControllerWorkflow struct {
	*ControllerCommon
}

func NewControllerWorkflow

func NewControllerWorkflow(common *ControllerCommon) *ControllerWorkflow

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
}

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

func (*Error) AddFieldf

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

func (*Error) CheckNum

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) Errors

func (o *Error) Errors() bool

func (*Error) Fields

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

func (*Error) Send

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

func (*Error) SetMessage

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

func (*Error) ValidationToErrors

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

type MobileControllersV1

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

func NewMobileControllersV1

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

type Response

type Response struct {
	StatusCode int
	Payload    interface{}
}

simple response

func NewSuccess

func NewSuccess() *Response

func (*Response) Item

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

func (*Response) Page

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

func (*Response) Send

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

func (*Response) SetData

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

func (*Response) Success

func (r *Response) Success() *Response

Jump to

Keyboard shortcuts

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