Documentation
¶
Overview ¶
Package internal/models/api defines models to be used for API requests.
Package internal/models/api defines models to be used for API requests.
Package internal/models/api defines models to be used for API requests.
Index ¶
Constants ¶
const MAX_LENGTH_QUEUE_NAME = 20
Maximum length of a queue name.
const MAX_LENGTH_TOKEN_NAME = 20
Maximum length of a token name
const MIN_LENGTH_QUEUE_NAME = 4
Minimum length of a queue name.
const MIN_LENGTH_TOKEN_NAME = 4
Minimum length of a token name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddTokenRequest ¶
AddTokenRequest is a model to structure an add token request.
Members ¶
QueueId - QueueId of the queue that this token is to be added to Name - Name of the token, typically name of the person whom the
token was issued to.
ContactNumber - Contact Number. EmailId - Optional. Email ID if the queue collects email ID of users.
func (AddTokenRequest) Validate ¶
func (req AddTokenRequest) Validate() (ValidationError, bool)
type AddTokenResponse ¶
AddTokenResponse is a model to structure the response of an add token request.
type CreateQueueRequest ¶
type CreateQueueRequest struct {
QueueName string
}
CreateQueueRequest is a model to structure a create queue request.
Members ¶
QueueName - Name of the queue to be created.
func (CreateQueueRequest) Validate ¶
func (req CreateQueueRequest) Validate() (ValidationError, bool)
Validate function for CreateQueueRequest validates if the queue name is within the defined range.
type CreateQueueResponse ¶
CreateQueueResponse is a model to strcuture the response of a create queue request.
type ValidationError ¶
Structure ValidationError is used to describe an error that occurs in a validation.
Members ¶
Field - name of the field which had an error. Message - description of the error.
type Validator ¶
type Validator interface {
// Method Validate validates the request data.
// Returns ValidationError, false if the request data is invalid.
// Returns ValidationError, true if the request data is valid.
// If ValidationError, true is returned ValidationError is empty and
// should be ignored.
Validate() (ValidationError, bool)
}
Interface Validator defines how to define a validator for a request.