Versions in this module Expand all Collapse all v2 v2.0.1 Jan 21, 2022 Changes in this version + var ErrHMSTypeInvalid = e.NewChild("got HMSTypeInvalid instead of valid type") + var ErrHMSTypeUnsupported = e.NewChild("HMSType value not supported for this operation") v2.0.0 Jan 13, 2022 Changes in this version + const HMSErrorUnsetDefault + const ProblemDetailContentType + const ProblemDetailsHTTPStatusType + const USERAGENT + var ErrHMSNeedForce = e.NewChild("operation not allowed and not forced.") + var ErrHMSStateInvalid = e.NewChild("was not a valid HMS state") + var ErrHMSStateUnsupported = e.NewChild("HMSState value not supported for this operation") + var JStatString = map[JobStatus]string + func GetHMSArchList() []string + func GetHMSClassList() []string + func GetHMSFlagList() []string + func GetHMSNetTypeList() []string + func GetHMSRoleList() []string + func GetHMSStateList() []string + func GetHMSSubRoleList() []string + func GetServiceInstanceName() (string, error) + func GetValidStartStateWForce(afterState string, force bool) (beforeStates []string, err error) + func GetValidStartStates(afterState string) (beforeStates []string, ok bool) + func InitTypes(configpath string) error + func IsAlphaNum(s string) bool + func IsHMSError(err error) bool + func IsHMSErrorClass(err error, class string) bool + func IsHMSErrorClassIgnCase(err error, class string) bool + func IsNumeric(s string) bool + func IsPostBootState(stateStr string) bool + func RemoveLeadingZeros(s string) string + func SendProblemDetails(w http.ResponseWriter, p *ProblemDetails, status int) error + func SendProblemDetailsGeneric(w http.ResponseWriter, status int, msg string) error + func SetHTTPUserAgent(req *http.Request, instName string) + func VerifyNormalizeArch(archStr string) string + func VerifyNormalizeClass(classStr string) string + func VerifyNormalizeFlag(flagStr string) string + func VerifyNormalizeFlagOK(flag string) string + func VerifyNormalizeNetType(netTypeStr string) string + func VerifyNormalizeRole(roleStr string) string + func VerifyNormalizeState(stateStr string) string + func VerifyNormalizeSubRole(subRoleStr string) string + type Auth struct + Password string + Username string + func (auth Auth) String() string + type Component struct + Arch string + Class string + Enabled *bool + Flag string + ID string + Locked bool + NID json.Number + NetType string + ReservationDisabled bool + Role string + State string + SubRole string + Subtype string + SwStatus string + Type string + type ComponentArray struct + Components []*Component + type HMSArch string + const ArchARM + const ArchOther + const ArchUnknown + const ArchX86 + func (r HMSArch) String() string + type HMSClass string + const ClassHill + const ClassMountain + const ClassRiver + func (r HMSClass) String() string + type HMSError struct + Class string + Message string + Problem *ProblemDetails + func GetHMSError(err error) (*HMSError, bool) + func NewHMSError(class, msg string) *HMSError + func (e *HMSError) AddProblem(p *ProblemDetails) + func (e *HMSError) Error() string + func (e *HMSError) GetProblem() *ProblemDetails + func (e *HMSError) IsClass(class string) bool + func (e *HMSError) IsClassIgnCase(class string) bool + func (e *HMSError) NewChild(msg string) *HMSError + func (e *HMSError) NewChildWithProblem(msg, instance string) *HMSError + type HMSFlag string + const FlagAlert + const FlagLocked + const FlagOK + const FlagUnknown + const FlagWarning + func (f HMSFlag) String() string + type HMSNetType string + const NetEthernet + const NetInfiniband + const NetNone + const NetOEM + const NetSling + func (r HMSNetType) String() string + type HMSRole string + const RoleApplication + const RoleCompute + const RoleManagement + const RoleService + const RoleStorage + const RoleSystem + func (r HMSRole) String() string + type HMSState string + const StateEmpty + const StateHalt + const StateOff + const StateOn + const StatePopulated + const StateReady + const StateStandby + const StateUnknown + func (s HMSState) String() string + type HMSSubRole string + const SubRoleMaster + const SubRoleStorage + const SubRoleWorker + func (r HMSSubRole) String() string + type HTTPRequest struct + Auth *Auth + ContentType string + Context context.Context + ExpectedStatusCode int + FullURL string + Method string + Payload []byte + SkipTLSVerify bool + Timeout time.Duration + func NewHTTPRequest(fullURL string) *HTTPRequest + func (request *HTTPRequest) DoHTTPAction() (payloadBytes []byte, err error) + func (request *HTTPRequest) GetBodyForHTTPRequest() (v interface{}, err error) + func (request *HTTPRequest) String() string + type Job interface + Cancel func() JobStatus + GetStatus func() (JobStatus, error) + Log func(format string, a ...interface{}) + Run func() + SetStatus func(JobStatus, error) (JobStatus, error) + Type func() JobType + type JobStatus int + const JSTAT_CANCELLED + const JSTAT_COMPLETE + const JSTAT_DEFAULT + const JSTAT_ERROR + const JSTAT_MAX + const JSTAT_PROCESSING + const JSTAT_QUEUED + type JobType int + type ProblemDetails struct + Detail string + Instance string + Status int + Title string + Type string + func NewProblemDetails(ptype, title, detail, instance string, status int) *ProblemDetails + func NewProblemDetailsStatus(detail string, status int) *ProblemDetails + func (p *ProblemDetails) NewChild(detail, instance string) *ProblemDetails + type Worker struct + JobChannel chan Job + StopChannel chan bool + WorkerPool chan chan Job + func NewWorker(workerPool chan chan Job) Worker + func (w Worker) Start() + func (w Worker) Stop() + type WorkerPool struct + JobQueue chan Job + Pool chan chan Job + StopChannel chan bool + Workers []Worker + func NewWorkerPool(maxWorkers, maxJobQueue int) *WorkerPool + func (p *WorkerPool) Queue(job Job) int + func (p *WorkerPool) Run() + func (p *WorkerPool) Stop() Other modules containing this package github.com/Cray-HPE/hms-base