model

package
v0.0.0-...-b4f25da Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func ChangeAccountPassword

func ChangeAccountPassword(username string, oldPassword string, newPassword string) (bool, error)

func ConnectDatabase

func ConnectDatabase(dbPath string) error

func ConvertSqliteTimestamp

func ConvertSqliteTimestamp(t string) string

func CreateArchitecture

func CreateArchitecture(a Architecture, id int) (bool, error)

func CreateBuilding

func CreateBuilding(b Building, id int) (bool, error)

func CreateMachineRole

func CreateMachineRole(m MachineRole, id int) (bool, error)

func CreateNetworkInterface

func CreateNetworkInterface(n NetworkInterface, id int) (bool, error)

func CreateOSFamily

func CreateOSFamily(osFamily OperatingSystemFamily, id int) (bool, error)

func CreateOSVersion

func CreateOSVersion(osVersion OperatingSystemVersion, id int) (bool, error)

func CreateOU

func CreateOU(o OrgUnit, id int) (bool, error)

func CreateOperatingSystem

func CreateOperatingSystem(os OperatingSystem, id int) (bool, error)

func CreateRole

func CreateRole(r Role) (bool, error)

func CreateStorageVolume

func CreateStorageVolume(s StorageVolume, id int) (bool, error)

func CreateUser

func CreateUser(p ProposedUser) (bool, error)

func CreateVendor

func CreateVendor(v Vendor, id int) (bool, error)

func DeleteArchitecture

func DeleteArchitecture(architectureId int) (bool, error)

func DeleteBuilding

func DeleteBuilding(buildingId int) (bool, error)

func DeleteMachineRole

func DeleteMachineRole(machineRoleId int) (bool, error)

func DeleteNetworkInterface

func DeleteNetworkInterface(networkInterfaceId int) (bool, error)

func DeleteOSFamily

func DeleteOSFamily(osFamilyIdId int) (bool, error)

func DeleteOSVersion

func DeleteOSVersion(osVersionId int) (bool, error)

func DeleteOU

func DeleteOU(ouId int) (bool, error)

func DeleteOperatingSystem

func DeleteOperatingSystem(osId int) (bool, error)

func DeleteRole

func DeleteRole(roleId int) (bool, error)

func DeleteStorageVolume

func DeleteStorageVolume(storageVolumeId int) (bool, error)

func DeleteUser

func DeleteUser(username string) (bool, error)

func DeleteVendor

func DeleteVendor(vendorId int) (bool, error)

func GetUserStatus

func GetUserStatus(username string) (string, error)

func SetUserOuId

func SetUserOuId(username string, j UserOrgUnitId) (bool, error)

func SetUserRoleId

func SetUserRoleId(username string, j UserRoleId) (bool, error)

func SetUserStatus

func SetUserStatus(username string, j UserStatus) (bool, error)

func UpdateBuildingById

func UpdateBuildingById(buildingId int, b Building) (bool, error)

func UpdateMachineRoleById

func UpdateMachineRoleById(machineRoleId int, m MachineRole) (bool, error)

func UpdateNetworkInterface

func UpdateNetworkInterface(networkInterfaceId int, n NetworkInterface) (bool, error)

func UpdateOperatingSystemById

func UpdateOperatingSystemById(osId int, os OperatingSystem) (bool, error)

func UpdateStorageVolume

func UpdateStorageVolume(id int, s StorageVolume) (bool, error)

Types

type Architecture

type Architecture struct {
	Id           int    `json:"Id"`
	ISEName      string `json:"iseName"`
	RegisterSize int    `json:"registerSize"`
	CreatorId    int    `json:"creatorId"`
	CreationDate string `json:"creationDate"`
}

primary object structs

func GetArchitectureById

func GetArchitectureById(id int) (Architecture, error)

func GetArchitectureByName

func GetArchitectureByName(architectureName string) (Architecture, error)

func GetArchitectures

func GetArchitectures() ([]Architecture, error)

type ArchitectureList

type ArchitectureList struct {
	Data []Architecture `json:"data"`
}

type Building

type Building struct {
	Id           int    `json:"Id"`
	BuildingName string `json:"buildingName"`
	ShortName    string `json:"shortName"`
	City         string `json:"city"`
	Region       string `json:"region"`
	CreatorId    int    `json:"creatorId"`
	CreationDate string `json:"creationDate"`
}

func GetBuildingById

func GetBuildingById(id int) (Building, error)

func GetBuildingByShortName

func GetBuildingByShortName(buildingShortName string) (Building, error)

func GetBuildings

func GetBuildings() ([]Building, error)

type BuildingList

type BuildingList struct {
	Data []Building `json:"data"`
}

type FailureMsg

type FailureMsg struct {
	Error string `json:"error"`
}

type InvalidStatusValue

type InvalidStatusValue struct {
	Err error
}

func (*InvalidStatusValue) Error

func (i *InvalidStatusValue) Error() string

type MachineRole

type MachineRole struct {
	Id              int    `json:"Id"`
	MachineRoleName string `json:"machineRoleName"`
	Description     string `json:"description"`
	CreatorId       int    `json:"creatorId"`
	CreationDate    string `json:"creationDate"`
}

func GetMachineRoleById

func GetMachineRoleById(id int) (MachineRole, error)

func GetMachineRoleByName

func GetMachineRoleByName(machineRoleName string) (MachineRole, error)

func GetMachineRoles

func GetMachineRoles() ([]MachineRole, error)

type MachineRoleList

type MachineRoleList struct {
	Data []MachineRole `json:"data"`
}

type NetworkInterface

type NetworkInterface struct {
	Id           int    `json:"Id"`
	DeviceModel  string `json:"deviceModel"`
	DeviceId     string `json:"deviceId"`
	MACAddress   string `json:"macAddress"`
	SystemId     int    `json:"systemId"`
	IpAddress    string `json:"ipAddress"`
	Bitmask      int    `json:"bitmask"`
	Gateway      string `json:"gateway"`
	CreatorId    int    `json:"creatorId"`
	CreationDate string `json:"creationDate"`
}

func GetNetworkInterfaceById

func GetNetworkInterfaceById(id int) (NetworkInterface, error)

func GetNetworkInterfaceByIpAddress

func GetNetworkInterfaceByIpAddress(ipAddr string) (NetworkInterface, error)

func GetNetworkInterfaceByMACAddress

func GetNetworkInterfaceByMACAddress(macAddress string) (NetworkInterface, error)

func GetNetworkInterfaces

func GetNetworkInterfaces() ([]NetworkInterface, error)

func GetNetworkInterfacesBySystemId

func GetNetworkInterfacesBySystemId(systemId int) ([]NetworkInterface, error)

type NetworkInterfaces

type NetworkInterfaces struct {
	Interfaces []NetworkInterface `json:"interfaces"`
}

Note that this is not stored in the DB, rather it is synthesized off the runtime data

type OperatingSystem

type OperatingSystem struct {
	Id               int    `json:"Id"`
	OSName           string `json:"osName"`
	OSFamilyId       int    `json:"osFamilyId"`
	VendorId         int    `json:"vendorId"`
	OSImageUrl       string `json:"osImageUrl"`
	ImageUriProtocol string `json:"imageUriProtocol"`
	CreatorId        int    `json:"creatorId"`
	CreationDate     string `json:"creationDate"`
}

func GetOperatingSystemById

func GetOperatingSystemById(id int) (OperatingSystem, error)

func GetOperatingSystems

func GetOperatingSystems() ([]OperatingSystem, error)

func GetOperatingSystemsByFamilyId

func GetOperatingSystemsByFamilyId(osFamilyId int) ([]OperatingSystem, error)

func GetOperatingSystemsByVendorId

func GetOperatingSystemsByVendorId(osVendorId int) ([]OperatingSystem, error)

type OperatingSystemFamily

type OperatingSystemFamily struct {
	Id           int    `json:"Id"`
	OSFamilyName string `json:"osFamilyName"`
	CreatorId    int    `json:"creatorId"`
	CreationDate string `json:"creationDate"`
}

func GetOSFamilies

func GetOSFamilies() ([]OperatingSystemFamily, error)

func GetOSFamilyById

func GetOSFamilyById(id int) (OperatingSystemFamily, error)

func GetOSFamilyByName

func GetOSFamilyByName(name string) (OperatingSystemFamily, error)

type OperatingSystemFamilyList

type OperatingSystemFamilyList struct {
	Data []OperatingSystemFamily `json:"data"`
}

type OperatingSystemList

type OperatingSystemList struct {
	Data []OperatingSystem `json:"data"`
}

type OperatingSystemVersion

type OperatingSystemVersion struct {
	Id                int    `json:"Id"`
	OperatingSystemId int    `json:"osId"`
	VersionNumber     string `json:"versionNumber"`
	CreatorId         int    `json:"creatorId"`
	CreationDate      string `json:"creationDate"`
}

func GetOSVersionById

func GetOSVersionById(id int) (OperatingSystemVersion, error)

func GetOSVersions

func GetOSVersions() ([]OperatingSystemVersion, error)

func GetOSVersionsByOSId

func GetOSVersionsByOSId(osId int) ([]OperatingSystemVersion, error)

type OperatingSystemVersionList

type OperatingSystemVersionList struct {
	Data []OperatingSystemVersion `json:"data"`
}

type OrgUnit

type OrgUnit struct {
	Id           int    `json:"Id"`
	OUName       string `json:"ouName"`
	Description  string `json:"description"`
	CreatorId    int    `json:"creatorId"`
	CreationDate string `json:"creationDate"`
}

func GetOUById

func GetOUById(id int) (OrgUnit, error)

func GetOUs

func GetOUs() ([]OrgUnit, error)

type OrgUnitList

type OrgUnitList struct {
	Data []OrgUnit `json:"data"`
}

type PasswordChange

type PasswordChange struct {
	OldPassword string `json:"oldPassword"`
	NewPassword string `json:"newPassword"`
}

type PasswordHashMismatch

type PasswordHashMismatch struct {
	Err error
}

func (*PasswordHashMismatch) Error

func (p *PasswordHashMismatch) Error() string

type ProposedUser

type ProposedUser struct {
	Id        int    `json:"Id"`
	UserName  string `json:"userName"`
	FullName  string `json:"fullName"`
	Status    string `json:"status" enum:"enabled,disabled"`
	OrgUnitId int    `json:"orgUnitId"`
	RoleId    int    `json:"roleId"`
	Password  string `json:"password"`
}

type Role

type Role struct {
	Id           int    `json:"Id"`
	RoleName     string `json:"roleName"`
	Description  string `json:"description"`
	CreationDate string `json:"creationDate"`
}

func GetRoleById

func GetRoleById(id int) (Role, error)

func GetRoleByName

func GetRoleByName(roleName string) (Role, error)

func GetRoles

func GetRoles() ([]Role, error)

type RolesList

type RolesList struct {
	Data []Role `json:"data"`
}

type StorageVolume

type StorageVolume struct {
	Id           int    `json:"Id"`
	VolumeName   string `json:"volumeName"`
	StorageType  string `json:"storageType"`
	DeviceModel  string `json:"deviceModel"`
	DeviceId     string `json:"deviceId"`
	MountPoint   string `json:"mountPoint"`
	VolumeSize   int    `json:"volumeSize"`
	VolumeFormat string `json:"volumeFormat"`
	VolumeLabel  string `json:"volumeLabel"`
	SystemId     int    `json:"systemId"`
	CreatorId    int    `json:"creatorId"`
	CreationDate string `json:"creationDate"`
}

func GetStorageVolumeById

func GetStorageVolumeById(id int) (StorageVolume, error)

func GetStorageVolumeByLabel

func GetStorageVolumeByLabel(label string, id int) (StorageVolume, error)

func GetStorageVolumes

func GetStorageVolumes() ([]StorageVolume, error)

func GetStorageVolumesBySystemId

func GetStorageVolumesBySystemId(systemId int) ([]StorageVolume, error)

type StorageVolumes

type StorageVolumes struct {
	Volumes []StorageVolume `json:"volumes"`
}

Note that this is not stored in the DB, it's synthesized from the data

type SuccessMsg

type SuccessMsg struct {
	Message string `json:"message"`
}

type System

type System struct {
	Id                int    `json:"Id"`
	SerialNumber      string `json:"serialNumber"`
	ModelId           int    `json:"modelId"`
	OperatingSystemId int    `json:"osId"`
	Reimage           bool   `json:"reimage"`
	HostVars          string `json:"HostVars"`
	BilledToOrgUnitId int    `json:"billedToOrgUnitId"`
	VendorId          int    `json:"vendorId"`
	ArchitectureId    int    `json:"architectureId"`
	RAM               int    `json:"ram"`
	CpuCores          int    `json:"cpuCores"`
	CreatorId         int    `json:"creatorId"`
	CreationDate      string `json:"creationDate"`
}

type SystemList

type SystemList struct {
	Data []System `json:"data"`
}

type User

type User struct {
	Id                      int    `json:"Id"`
	UserName                string `json:"userName"`
	FullName                string `json:"fullName"`
	Status                  string `json:"status"`
	OrgUnitId               int    `json:"orgUnitId"`
	RoleId                  int    `json:"roleId"`
	PasswordHash            string `json:"passwordHash"`
	CreationDate            string `json:"creationDate"`
	LastPasswordChangedDate string `json:"lastPasswordChangedDate"`
}

func GetUserById

func GetUserById(id int) (User, error)

func GetUserByUserName

func GetUserByUserName(username string) (User, error)

func GetUsers

func GetUsers() ([]User, error)

func GetUsersByOuId

func GetUsersByOuId(ouId int) ([]User, error)

func GetUsersByRoleId

func GetUsersByRoleId(roleId int) ([]User, error)

type UserOrgUnitId

type UserOrgUnitId struct {
	OrgUnitId int `json:"orgUnitId"`
}

type UserOrgUnitIdMsg

type UserOrgUnitIdMsg struct {
	Message       string `json:"message"`
	UserOrgUnitId int    `json:"orgUnitId"`
}

type UserRoleId

type UserRoleId struct {
	RoleId int `json:"roleId"`
}

type UserRoleIdMsg

type UserRoleIdMsg struct {
	Message    string `json:"message"`
	UserRoleId int    `json:"roleId"`
}

type UserStatus

type UserStatus struct {
	Status string `json:"status" enum:"enabled,disabled"`
}

type UserStatusMsg

type UserStatusMsg struct {
	Message    string `json:"message"`
	UserStatus string `json:"userStatus" enum:"enabled,disabled"`
}

type UsersList

type UsersList struct {
	Data []User `json:"data"`
}

type Vendor

type Vendor struct {
	Id           int    `json:"Id"`
	VendorName   string `json:"vendorName"`
	CreatorId    int    `json:"creatorId"`
	CreationDate string `json:"creationDate"`
}

func GetVendorById

func GetVendorById(id int) (Vendor, error)

func GetVendorByName

func GetVendorByName(vendorName string) (Vendor, error)

func GetVendors

func GetVendors() ([]Vendor, error)

type VendorList

type VendorList struct {
	Data []Vendor `json:"data"`
}

Jump to

Keyboard shortcuts

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