models

package
v0.0.0-...-d4224cb Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInternalServerError returns a new Internal Server Error
	ErrInternalServerError = errors.New("Internal Server Error")
	// ErrNotFound returns a new Not Found Error
	ErrNotFound = errors.New("Your requested Item is not found")
	// ErrConflict returns a new Conflict error
	ErrConflict = errors.New("Your Item already exists")
	// ErrBadParamInput returns a Bad Parameter Input Error
	ErrBadParamInput = errors.New("Given Param is not valid")
	// ErrUnauthorized returns a new Unauthorized Error
	ErrUnauthorized = errors.New("Missing or Invalid authentication token")
	// ErrDatabaseError returns a New Database Error
	ErrDatabaseError = errors.New("An error has occurred in the database")
)

var error model to map to http errors

Functions

This section is empty.

Types

type App

type App struct {
	ID                    string     `json:"id"`
	AppID                 string     `json:"appId"`
	AppName               string     `json:"appName,omitempty"`
	NumOfDeployedVersions *int       `json:"numOfDeployedVersions,omitempty"`
	NumOfCurrentInstalls  *int       `json:"numOfCurrentInstalls,omitempty"`
	NumOfAppLaunches      *int       `json:"numOfAppLaunches,omitempty"`
	DeployedVersions      *[]Version `json:"deployedVersions,omitempty"`
	DeletedAt             string     `json:"deletedAt,omitempty"`
}

App is the model struct for apps swagger:model App

func NewAppByNameAndAppID

func NewAppByNameAndAppID(name, appId string) *App

NewAppByNameAndAppID will create a new App object based on the name and appId which indeed are the only values according to the business that can be used/provided in order to the service create an app. This will be used in the systems which would consume the REST API to create new apps. ( E.g Operator )

type Device

type Device struct {
	ID            string `json:"id"`
	VersionID     string `json:"versionId"`
	Version       string `json:"version"`
	AppID         string `json:"appId"`
	DeviceID      string `json:"deviceId"`
	DeviceVersion string `json:"deviceVersion"`
	DeviceType    string `json:"deviceType"`
}

Device model swagger:model Device

func NewDevice

func NewDevice(versionID string, version string, appID string, deviceID string, deviceVersion string, deviceType string) *Device

NewDevice returns a new Device model

type User

type User struct {
	Username string `json:"username"`
	Email    string `json:"email"`
}

User is the model struct for users swagger:model User

type Version

type Version struct {
	ID                   string   `json:"id"`
	Version              string   `json:"version"`
	AppID                string   `json:"appId"`
	Disabled             bool     `json:"disabled"`
	DisabledMessage      string   `json:"disabledMessage"`
	NumOfCurrentInstalls int64    `json:"numOfCurrentInstalls,omitempty"`
	NumOfAppLaunches     int64    `json:"numOfAppLaunches,omitempty"`
	LastLaunchedAt       string   `json:"lastLaunchedAt,omitempty"`
	Devices              []Device `json:"devices,omitempty"`
}

Version model swagger:model Version

Jump to

Keyboard shortcuts

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