Documentation ¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- type AddClusterRequest
- type AddStorageBlockDeviceRequest
- type AddStorageNodeRequest
- type AddStorageRequest
- type AlarmStatus
- type ApiRoute
- type AppEvent
- type AppTask
- type AsyncResponse
- type BlockDevice
- type Cluster
- type ClusterForImport
- type ClusterNetworks
- type ClusterNode
- type ClusterNodeDevice
- type ClusterNotificationSubscription
- type ClusterState
- type ClusterStatus
- type ClusterSummary
- type Clusters
- type CollectdCpuMetric
- type CollectdSingleValuedMetric
- type Cpu
- type Directory
- type Disk
- type DiskHierarchyDetails
- type DiskHierarchyRequest
- type DiskProfile
- type DiskType
- type Event
- type ExternalUsers
- type ImportClusterRequest
- type MailNotifier
- type Memory
- type MonitoringState
- type Network
- type Node
- type NodeEvent
- type NodeForImport
- type NodeState
- type NodeStatus
- type Nodes
- type NotificationEntity
- type NotificationSubscription
- type OperatingSystem
- type QueryOps
- type RpcRequest
- type RpcResponse
- type RpcResponseData
- type RpcResponseStatus
- type SluStatus
- type SnapshotSchedule
- type SnapshotScheduleRequest
- type Status
- type Storage
- type StorageLogicalUnit
- type StorageProfile
- type StorageProviderInterface
- type StorageStatus
- type StorageUsage
- type Storages
- type System
- type TaskStatus
- type ThresholdEvent
- type UnmanagedNode
- type UnmanagedNodes
- type User
- type Utilization
Constants ¶
const ( DEFAULT_SSH_PORT = 22 DEFAULT_FS_TYPE = "xfs" ENGINE_NAME = "skyring" NODE_TYPE_OSD = "OSD" REQUEST_SIZE_LIMIT = 1048576 COLL_NAME_STORAGE = "storage" COLL_NAME_NODE_EVENTS = "node_events" COLL_NAME_APP_EVENTS = "app_events" COLL_NAME_STORAGE_NODES = "storage_nodes" COLL_NAME_STORAGE_CLUSTERS = "storage_clusters" COLL_NAME_SKYRING_UTILIZATION = "skyring_utilization" COLL_NAME_CLUSTER_SUMMARY = "cluster_summary" COLL_NAME_STORAGE_LOGICAL_UNITS = "storage_logical_units" COLL_NAME_TASKS = "tasks" COLL_NAME_SESSION_STORE = "skyring_session_store" COLL_NAME_USER = "skyringusers" COLL_NAME_STORAGE_PROFILE = "storage_profile" COLL_NAME_MAIL_NOTIFIER = "mailnotifier" COLL_NAME_LDAP = "ldap" COLL_NAME_BLOCK_DEVICES = "block_devices" COLL_NAME_SYSTEM_CAPABILITIES = "system_capabilities" COLL_NAME_THRESHOLD_BREACHES = "threshold_breaches" COLL_NAME_CLUSTER_NOTIFICATION_SUBSCRIPTIONS = "cluster_notification_subscriptions" COLL_NAME_ARCHIVE_TASKS = "archive_tasks" COLL_NAME_ARCHIVE_EVENTS = "archive_events" TASKS_PER_PAGE = 100 LDAP_USERS_PER_PAGE = 100 EVENTS_PER_PAGE = 100 CriticalAlerts = "criticalAlerts" STORAGE_TYPE_REPLICATED = "replicated" STORAGE_TYPE_ERASURE_CODED = "erasure_coded" Monitor = "monitor" Mon = "mon" Yes = "Y" No = "N" TotalSLU = "TotalSLU" ErrorSLU = "ErrorSLU" WarningSLU = "WarningSLU" DownSLU = "DownSLU" SLU_STATE_DOWN = "Out" SKYRING_ENC_KEY_FILE = "/var/run/.skyring_enc_key" )
const ( CLUSTER_STATUS_OK = iota CLUSTER_STATUS_WARN CLUSTER_STATUS_ERROR CLUSTER_STATUS_UNKNOWN )
Status values for the cluster
const ( CLUSTER_STATE_CREATING = iota CLUSTER_STATE_FAILED CLUSTER_STATE_ACTIVE CLUSTER_STATE_UNMANAGED CLUSTER_STATE_SYNCING )
State values for cluster
const ( STATUS_UP = "up" STATUS_DOWN = "down" STATUS_OK = "ok" STATUS_WARN = "warning" STATUS_ERR = "error" )
const ( TASK_STATUS_NONE = iota TASK_STATUS_SUCCESS TASK_STATUS_TIMED_OUT TASK_STATUS_FAILURE )
const ( NONE = iota SAS SSD )
const ( DefaultProfile1 = "sas" DefaultProfile2 = "ssd" DefaultProfile3 = "default" DefaultPriority = 100 )
const ( NODE_STATE_UNACCEPTED = iota NODE_STATE_INITIALIZING NODE_STATE_ACTIVE NODE_STATE_FAILED NODE_STATE_UNMANAGED NODE_STATE_IMPORTING )
const ( NODES = "nodes" CLUSTER = "cluster" TOTAL = "total" SYSTEM = "system" )
const ( NODE_STATUS_OK = iota NODE_STATUS_WARN NODE_STATUS_ERROR NODE_STATUS_UNKNOWN )
Status values for the cluster
const ( ALARM_STATUS_INDETERMINATE = iota ALARM_STATUS_CRITICAL ALARM_STATUS_MAJOR ALARM_STATUS_MINOR ALARM_STATUS_WARNING ALARM_STATUS_CLEARED )
Status values for the cluster
const ( NOTIFICATION_ENTITY_HOST = iota NOTIFICATION_ENTITY_CLUSTER NOTIFICATION_ENTITY_SLU NOTIFICATION_ENTITY_STORAGE NOTIFICATION_ENTITY_USER NOTIFICATION_ENTITY_BLOCK_DEVICE NOTIFICATION_ENTITY_STORAGE_PROFILE NOTIFICATION_ENTITY_MAIL_NOTIFIER )
types of notification entities
const ( SLU_STATUS_OK = iota SLU_STATUS_WARN SLU_STATUS_ERROR SLU_STATUS_UNKNOWN )
Status values for the cluster
const ( STORAGE_STATUS_OK = iota STORAGE_STATUS_WARN STORAGE_STATUS_ERROR STORAGE_STATUS_UNKNOWN )
Status values for the cluster
const ( CURRENT_VALUE = "CurrentValue" CLUSTER_ID = "ClusterId" ENTITY_ID = "EntityId" PLUGIN = "Plugin" THRESHOLD_TYPE = "ThresholdType" THRESHOLD_VALUE = "ThresholdValue" ENTITY_NAME = "EntityName" CLUSTER_CONFIGS = "cluster_configs" THRESHOLD_CONFIGS = "threshold_configs" NOTIFICATION_LIST = "notification_list" UTILIZATIONS = "utilizations" NOTIFY = "Notify" WARNING = "WARNING" OK = "OK" CRITICAL = "CRITICAL" NEAR_FULL = "nearfull" )
const ( CLUSTER_AVAILABILITY = "cluster_availability" QUORUM_LOSS = "quorum_loss" HOST_AVAILABILITY = "host_availability" )
const (
CEPH_OSD = 1 + iota
)
Storage logical unit types
Variables ¶
var AlarmStatuses = [...]string{
"indeterminate",
"critical",
"major",
"minor",
"warning",
"cleared",
}
var ClusterStates = [...]string{
"creating",
"failed",
"active",
"unmanaged",
"syncing",
}
var ClusterStatuses = [...]string{
"ok",
"warning",
"error",
"unknown",
}
var DiskTypes = [...]string{
"none",
"sas",
"ssd",
}
var NodeStates = [...]string{
"unaccepted",
"initializing",
"active",
"failed",
"unmanaged",
"importing",
}
var NodeStatuses = [...]string{
"ok",
"warning",
"error",
"unknown",
}
var NotificationEntities = [...]string{
"Host",
"Cluster",
"Slu",
"Storage",
"User",
"Block Device",
"Storage Profile",
"Mail Notifier",
}
var Notifications = []NotificationSubscription{ { Name: CLUSTER_AVAILABILITY, Description: "Cluster Availability", Enabled: true, }, { Name: HOST_AVAILABILITY, Description: "Host Availability", Enabled: true, }, { Name: QUORUM_LOSS, Description: "Quorum Loss", Enabled: false, }, }
var SkyringServices = [...]string{
"collectd",
"salt-minion",
}
var SluStatuses = [...]string{
"ok",
"warning",
"error",
"unknown",
}
var StorageLogicalUnitTypes = [...]string{
"osd",
}
var StorageStatuses = [...]string{
"ok",
"warning",
"error",
"unknown",
}
var TaskStatuses = [...]string{
"none",
"success",
"timedout",
"failed",
}
Functions ¶
This section is empty.
Types ¶
type AddClusterRequest ¶
type AddClusterRequest struct { Name string `json:"name"` CompatVersion string `json:"compat_version"` Type string `json:"type"` WorkLoad string `json:"workload"` Tags []string `json:"tags"` Options map[string]interface{} `json:"options"` OpenStackServices []string `json:"openstackservices"` Nodes []ClusterNode `json:"nodes"` Networks ClusterNetworks `json:"networks"` MonitoringPlugins []monitoring.Plugin `json:"monitoringplugins"` MonitoringInterval int `json:"monitoringinterval"` DisableAutoExpand bool `json:"disableautoexpand"` JournalSize string `json:"journalSize"` }
type AddStorageBlockDeviceRequest ¶
type AddStorageBlockDeviceRequest struct { Name string `json:"name"` Tags []string `json:"tags"` Size string `json:"size"` SnapshotsEnabled bool `json:"snapshots_enabled"` SnapshotSchedule SnapshotScheduleRequest `json:"snapshot_schedule"` QuotaEnabled bool `json:"quota_enabled"` QuotaParams map[string]string `json:"quota_params"` Options map[string]string `json:"options"` }
type AddStorageNodeRequest ¶
type AddStorageRequest ¶
type AddStorageRequest struct { Name string `json:"name"` Type string `json:"type"` Tags []string `json:"tags"` Size string `json:"size"` Replicas int `json:"replicas"` Profile string `json:"profile"` SnapshotsEnabled bool `json:"snapshots_enabled"` SnapshotSchedule SnapshotScheduleRequest `json:"snapshot_schedule"` QuotaEnabled bool `json:"quota_enabled"` QuotaParams map[string]string `json:"quota_params"` Options map[string]string `json:"options"` BlockDevices []AddStorageBlockDeviceRequest `json:"blockdevices"` }
type AlarmStatus ¶
type AlarmStatus int
func (AlarmStatus) String ¶
func (s AlarmStatus) String() string
type AppEvent ¶
type AppEvent struct { EventId uuid.UUID `json:"event_id"` ClusterId uuid.UUID `json:"cluster_id"` ClusterName string `json:"cluster_name"` NotificationEntity NotificationEntity `json:"notificationentity"` EntityId uuid.UUID `json:"entityid"` NodeId uuid.UUID `json:"node_id"` NodeName string `json:"nodename"` Timestamp time.Time `json:"timestamp"` Name string `json:"name"` Context string `json:"context"` Tags map[string]string `json:"tags"` Message string `json:"message"` Description string `json:"description"` Severity AlarmStatus `json:"severity"` CorrelationId uuid.UUID `json:"correlationid"` Acked bool `json:"acked"` UserAckedTime time.Time `json:"userackedtime"` SystemAckedTime time.Time `json:"systemackedtime"` AckedByUser string `json:"ackedbyuser"` AckedByEvent string `json:"ackedbyevent"` UserAckComment string `json:"userackcomment"` SystemAckComment string `json:"systemackcomment"` Notify bool `json:"notify"` Notified bool `json:"notified"` }
type AppTask ¶
type AppTask struct { Id uuid.UUID `json:"id"` Name string `json:"name"` Owner string `json:"owner"` ParentId uuid.UUID `json:"parentid"` Started bool `json:"started"` Completed bool `json:"completed"` StatusList []Status `json:"statuslist"` Tag map[string]string `json:"tag"` LastUpdated time.Time `json:"lastupdated"` SubTasks []uuid.UUID `json:"subtasks"` Status TaskStatus `json:"status"` }
type AsyncResponse ¶
type BlockDevice ¶
type BlockDevice struct { Id uuid.UUID `json:"id"` Name string `json:"name"` Tags []string `json:"tags"` ClusterId uuid.UUID `json:"clusterid"` ClusterName string `json:"clustername"` StorageId uuid.UUID `json:"storageid"` StorageName string `json:"storagename"` Size string `json:"size"` SnapshotsEnabled bool `json:"snapshots_enabled"` SnapshotScheduleIds []uuid.UUID `json:"snapshot_schedule_ids"` QuotaEnabled bool `json:"quota_enabled"` QuotaParams map[string]string `json:"quota_params"` Options map[string]string `json:"options"` Usage Utilization `json:"usage"` AlmStatus AlarmStatus `json:"almstatus"` AlmWarnCount int `json:"almwarncount"` AlmCritCount int `json:"almcritcount"` }
type Cluster ¶
type Cluster struct { ClusterId uuid.UUID `json:"clusterid"` Name string `json:"name"` CompatVersion string `json:"compat_version"` Type string `json:"type"` WorkLoad string `json:"workload"` Status ClusterStatus `json:"status"` Tags []string `json:"tags"` Options map[string]interface{} `json:"options"` OpenStackServices []string `json:"openstack_services"` Networks ClusterNetworks `json:"networks"` Monitoring MonitoringState `json:"monitoring"` MonitoringInterval int `json:"monitoringinterval"` State ClusterState `json:"state"` AlmStatus AlarmStatus `json:"almstatus"` AlmWarnCount int `json:"almwarncount"` AlmCritCount int `json:"almcritcount"` Usage Utilization `json:"usage"` StorageProfileUsage map[string]Utilization `json:"storageprofileusage"` ObjectCount map[string]int64 `json:"objectcount"` AutoExpand bool `json:"autoexpand"` JournalSize string `json:"journalsize"` Utilizations map[string]interface{} `json:"utilizations"` }
type ClusterForImport ¶
type ClusterNetworks ¶
type ClusterNode ¶
type ClusterNode struct { NodeId string `json:"nodeid"` NodeType []string `json:"nodetype"` Devices []ClusterNodeDevice `json:"disks"` Options map[string]string `json:"options"` }
type ClusterNodeDevice ¶
type ClusterNotificationSubscription ¶
type ClusterNotificationSubscription struct { ClusterId uuid.UUID `json:"clusterid"` Notifications []NotificationSubscription `json:"notifications"` }
type ClusterState ¶
type ClusterState int
func (ClusterState) String ¶
func (s ClusterState) String() string
type ClusterStatus ¶
type ClusterStatus int
func (ClusterStatus) String ¶
func (c ClusterStatus) String() string
type ClusterSummary ¶
type ClusterSummary struct { ClusterId uuid.UUID `json:"clusterid"` Type string `json:"type"` Name string `json:"name"` MostUsedStorages []StorageUsage `json:"storageusage"` Usage Utilization `json:"usage"` StorageProfileUsage map[string]map[string]interface{} `json:"storageprofileusage"` ObjectCount map[string]int64 `json:"objectcount"` StorageCount map[string]int `json:"storagecount"` SLUCount map[string]int `json:"slucount"` MonitoringPlugins []monitoring.Plugin `json:"monitoringplugins"` NodesCount map[string]int `json:"nodescount"` ProviderMonitoringDetails map[string]map[string]interface{} `json:"providermonitoringdetails"` Utilizations map[string]interface{} `json:"utilizations"` UpdatedAt string `json:"updatedat"` }
type CollectdCpuMetric ¶
type CollectdCpuMetric struct {
PercentUsed string `json:"PercentUsed"`
}
type Cpu ¶
type Cpu struct { Architecture string `bson:"architecture",json:"architecture"` CpuOpMode string `bson:"cpuopmode",json:"cpuopmode"` CPUs string `bson:"cpus",json:"cpus"` VendorId string `bson:"vendorid",json:"vendorid"` ModelName string `bson:"modelname",json:"modelname"` CPUFamily string `bson:"cpufamily",json:"cpufamily"` CPUMHz string `bson:"cpumhz",json:"cpumhz"` Model string `bson:"model",json:"model"` CoresPerSocket string `bson:"corespersocket",json:"corespersocket"` }
type Disk ¶
type Disk struct { DevName string `bson:"devname",json:"devname"` FSType string `bson:"fstype",json:"fstype"` FSUUID uuid.UUID `bson:"fsuuid",json:"fsuuid"` Model string `bson:"model",json:"model"` MountPoint []string `bson:"mountpoint",json:"mountpoint"` Name string `bson:"name",json:"name"` Parent string `bson:"parent",json:"parent"` Size float64 `bson:"size",json:"size"` Type string `bson:"type",json:"type"` Used bool `bson:"used",json:"used"` SSD bool `bson:"ssd",json:"ssd"` Vendor string `bson:"vendor",json:"vendor"` StorageProfile string `bson:"storageprofile",json:"storageprofile"` DiskId uuid.UUID `bson:"diskid",json:"diskid"` }
type DiskHierarchyDetails ¶
type DiskHierarchyRequest ¶
type DiskHierarchyRequest struct { ClusterName string `json:"clustername"` ClusterType string `json:"clustertype"` JournalSize string `json:"journals"` ClusterNodes []ClusterNode `json:"clusternodes"` }
type DiskProfile ¶
type Event ¶
type Event struct { EventId uuid.UUID `json:"event_id"` ClusterId uuid.UUID `json:"cluster_id"` NodeId uuid.UUID `json:"node_id"` Timestamp time.Time `json:"timestamp"` Tag string `json:"tag"` Tags map[string]string `json:"tags"` Message string `json:"message"` Severity string `json:"severity"` ImpactingEvents map[string][]Event `json:"impactingentities"` }
type ExternalUsers ¶
type ImportClusterRequest ¶
type MailNotifier ¶
type MailNotifier struct { MailId string `json:"mailid"` Passcode string `json:"passcode"` SmtpServer string `json:"smtpserver"` Port int `json:"port"` Encryption string `json:"encryption"` SkipVerify bool `json:"skipverify"` MailNotification bool `json:"mailnotification"` SubPrefix string `json:"subprefix"` }
type MonitoringState ¶
type MonitoringState struct { Plugins []monitoring.Plugin `json:"plugins"` StaleNodes []string `json:"stalenodes"` }
type Node ¶
type Node struct { NodeId uuid.UUID `json:"nodeid"` Roles []string `json:"roles"` Hostname string `json:"hostname"` Tags []string `json:"tags"` ManagementIP4 string `json:"management_ip4"` ClusterIP4 string `json:"cluster_ip4"` PublicIP4 string `json:"public_ip4"` ClusterId uuid.UUID `json:"clusterid"` Location string `json:"location"` Status NodeStatus `json:"status"` State NodeState `json:"state"` AlmStatus AlarmStatus `json:"almstatus"` AlmWarnCount int `json:"almwarncount"` AlmCritCount int `json:"almcritcount"` Options map[string]string `json:"options"` CPUs []Cpu `json:"cpus"` NetworkInfo Network `json:"network_info"` StorageDisks []Disk `json:"storage_disks"` Memory Memory `json:"memory"` OS OperatingSystem `json:"os"` Enabled bool `json:"enabled"` Fingerprint string `json:"saltfingerprint"` Utilizations map[string]Utilization `json:"utilizations"` ServiceStatusList map[string][]string `json:"servicestatuslist"` }
type NodeForImport ¶
type NodeStatus ¶
type NodeStatus int
func (NodeStatus) String ¶
func (s NodeStatus) String() string
type NotificationEntity ¶
type NotificationEntity int
func (NotificationEntity) String ¶
func (s NotificationEntity) String() string
type OperatingSystem ¶
type RpcRequest ¶
type RpcResponse ¶
type RpcResponse struct { Status RpcResponseStatus `json:"status"` Data RpcResponseData `json:"data"` }
type RpcResponseData ¶
type RpcResponseStatus ¶
type SnapshotSchedule ¶
type SnapshotScheduleRequest ¶
type Storage ¶
type Storage struct { StorageId uuid.UUID `json:"storageid"` Name string `json:"name"` Type string `json:"type"` Tags []string `json:"tags"` ClusterId uuid.UUID `json:"clusterid"` Size string `json:"size"` Status StorageStatus `json:"status"` Replicas int `json:"replicas"` Profile string `json:"profile"` SnapshotsEnabled bool `json:"snapshots_enabled"` SnapshotScheduleIds []uuid.UUID `json:"snapshot_schedule_ids"` QuotaEnabled bool `json:"quota_enabled"` QuotaParams map[string]string `json:"quota_params"` Options map[string]string `json:"options"` Usage Utilization `json:"usage"` State string `json:"state"` AlmStatus AlarmStatus `json:"almstatus"` AlmWarnCount int `json:"almwarncount"` AlmCritCount int `json:"almcritcount"` SluIds []uuid.UUID `json:"slus"` }
type StorageLogicalUnit ¶
type StorageLogicalUnit struct { SluId uuid.UUID `json:"sluid"` Name string `json:"name"` Type int `json:"type"` ClusterId uuid.UUID `json:"clusterid"` NodeId uuid.UUID `json:"nodeid"` StorageIds []uuid.UUID `json:"storageid"` StorageDeviceId uuid.UUID `json:"storagedeviceid"` StorageDeviceSize float64 `json:"storagedevicesize"` Status SluStatus `json:"status"` Options map[string]interface{} `json:"options"` StorageProfile string `json:"storageprofile"` State string `json:"state"` AlmStatus AlarmStatus `json:"almstatus"` AlmWarnCount int `json:"almwarncount"` AlmCritCount int `json:"almcritcount"` Usage Utilization `json:"usage"` }
type StorageProfile ¶
type StorageProfile struct { Name string `json:"name"` Rule DiskProfile `json:"rule"` Priority int `json:"priority"` Default bool `json:"default"` }
type StorageProviderInterface ¶
type StorageProviderInterface interface {
CreateCluster(req RpcRequest, resp *RpcResponse) error
}
*
- Below generic RPC methods should be implemented by storage providers
- to work with skyring.
- Input parameters:
- - req : RpcRequest instance
- Output parameter:
- - resp : pointer to RpcResponse instance
- Returns:
- - error
type StorageStatus ¶
type StorageStatus int
func (StorageStatus) String ¶
func (s StorageStatus) String() string
type StorageUsage ¶
type StorageUsage struct { Name string `json:"name"` Usage Utilization `json:"usage"` }
type System ¶
type System struct { Name string `json:"name"` Usage Utilization `json:"usage"` StorageProfileUsage map[string]map[string]interface{} `json:"storageprofileusage"` StorageCount map[string]int `json:"storagecount"` SLUCount map[string]int `json:"slucount"` NodesCount map[string]int `json:"nodescount"` ClustersCount map[string]int `json:"clusterscount"` MonitoringPlugins map[string]monitoring.Plugin `json:"monitoringplugins"` ProviderMonitoringDetails map[string]map[string]interface{} `json:"providermonitoringdetails"` MostUsedStorages []StorageUsage `json:"storageusage"` Utilizations map[string]interface{} `json:"utilizations"` UpdatedAt string `json:"updatedat"` }
type TaskStatus ¶
type TaskStatus int
func (TaskStatus) String ¶
func (t TaskStatus) String() string
type ThresholdEvent ¶
type UnmanagedNode ¶
type UnmanagedNodes ¶
type UnmanagedNodes []UnmanagedNode
type User ¶
type User struct { Username string `json:"username"` Email string `json:"email"` Hash []byte `json:"hash"` Role string `json:"role"` Groups []string `json:"groups"` Type int `json:"type"` Status bool `json:"status"` FirstName string `json:"firstname"` LastName string `json:"lastname"` NotificationEnabled bool `json:"notificationenabled"` }