Documentation ¶
Index ¶
Constants ¶
View Source
const ( RegexpMedicationName = "^[a-zA-Z0-9_-]*$" // allowed only letters, numbers, ‘-‘, ‘_’ RegexpMedicationCode = "^[A-Z0-9_]*$" // allowed only upper case letters, underscore and numbers MaxSerialNumberLength = "100" // serial number (100 characters max) WeightLimitDrone = 500 // weight limit (500gr max) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenData ¶
type AccessTokenData struct { Scope []string Claims InjectedParam }
AccessTokenData using by this REST Api (HLF client node) to grant access to the resources
type Drone ¶
type Drone struct { SerialNumber string `json:"serialNumber" valid:"maxstringlength(100)"` Model DroneModel `json:"model" valid:"drone_enum_validation~unknown drone model"` WeightLimit float64 `` /* 130-byte string literal not displayed */ BatteryCapacity float64 `json:"batteryCapacity" valid:"range(0|100)"` State DroneState `json:"state" valid:"drone_enum_validation~unknown drone state"` }
Drone model @Description Drone item information
type DroneBatteryLevel ¶
type DroneModel ¶
type DroneModel uint
const ( Lightweight DroneModel = iota Middleweight Cruiserweight Heavyweight )
func (DroneModel) String ¶
func (droneModel DroneModel) String() string
type DroneState ¶
type DroneState uint
const ( IDLE DroneState = iota LOADING LOADED DELIVERING DELIVERED RETURNING )
func (DroneState) String ¶
func (droneState DroneState) String() string
type GrantIntentResponse ¶
type InjectedParam ¶
type LogEvent ¶
type LogEvent struct { Created string `json:"created"` UUID string `json:"uuid"` DronesBatteryLevels []DroneBatteryLevel `json:"dronesBatteryLevels"` }
type Medication ¶
type Medication struct { Name string `json:"name" valid:"medication_name_validation~invalid name (allowed only letters - numbers - ‘-‘ - ‘_’)"` Weight float64 `json:"weight"` Code string `json:"code" valid:"medication_code_validation~invalid code (allowed only upper case letters - underscore and numbers)"` // we assume that the code is unique Image string `json:"image" valid:"base64"` }
Medication model @Description Medication item information
type Problem ¶
type Problem struct { Status uint `example:"503"` Title string `example:"err_code"` Detail string `example:"Some error details"` }
Problem api documentation
type RequestDrone ¶
type RequestDrone struct { SerialNumber string `json:"serialNumber" valid:"maxstringlength(100)"` Model DroneModel `json:"model" valid:"drone_enum_validation~unknown drone model"` BatteryCapacity float64 `json:"batteryCapacity" valid:"range(0|100)"` State DroneState `json:"state" valid:"drone_enum_validation~unknown drone state"` }
RequestDrone model @Description drone model without the weightLimit, it is used for endpoint request @Description the weight limit is calculated from the drone's model (Lightweight, Middleweight, Cruiserweight, Heavyweight)
type User ¶
type User struct { Username string `json:"username"` Passphrase string `json:"passphrase"` Name string `json:"name"` }
User struct
type UserCredIn ¶
type UserCredIn struct { Username string `example:"richard.sargon@meinermail.com" validate:"required,ascii,gte=3,lte=60"` Password string `example:"password1" validate:"required,ascii,gte=3,lte=20"` }
UserCredIn Is a example declaring the validation for tech struct. It will be used when the struct is in the endpoint parameters
Click to show internal directories.
Click to hide internal directories.