Documentation
¶
Index ¶
- Constants
- type AuthClientInterface
- type AuthorizationClient
- func (ac *AuthorizationClient) AddService(service Service) error
- func (ac *AuthorizationClient) AddServiceItem(si ServiceItem) error
- func (ac *AuthorizationClient) AddSystemType(sysType string) error
- func (ac *AuthorizationClient) DeleteService(service Service) error
- func (ac *AuthorizationClient) DeleteServiceItem(si ServiceItem) error
- func (ac *AuthorizationClient) GetAllServices() []Service
- func (ac *AuthorizationClient) GetAllSystemTypes() []SystemType
- func (ac *AuthorizationClient) GetHECConfig()
- func (ac *AuthorizationClient) GetLogin() Login
- func (ac *AuthorizationClient) GetService(ctx context.Context, services chan<- *Service)
- func (ac *AuthorizationClient) GetServiceItemWithIP(siip string) ServiceItem
- func (ac *AuthorizationClient) GetServiceItems(sip string) []ServiceItem
- func (ac *AuthorizationClient) GetServiceWithIP(ip string) Service
- func (ac *AuthorizationClient) GetValveStatus() []ValveState
- func (ac *AuthorizationClient) ResendAll()
- func (ac *AuthorizationClient) SplunkAddHEC(splunkHttp SplunkConfig) error
- func (ac *AuthorizationClient) UpdateLogin(l Login) error
- func (ac *AuthorizationClient) UpdateService(s Service) error
- func (ac *AuthorizationClient) UpdateServiceItem(si ServiceItem) error
- func (ac *AuthorizationClient) UpdateServiceItemState(state string, siip string) error
- func (ac *AuthorizationClient) UpdateServiceState(state string, sip string) error
- func (ac *AuthorizationClient) UpdateServiceX(s Service) error
- func (ac *AuthorizationClient) UpdateServiceXState(state string, ip string) error
- func (ac *AuthorizationClient) UpdateValveState(ip string, state1 string, state2 string) error
- type AuthorizationService
- type Command
- type Login
- type Service
- type ServiceItem
- type SplunkConfig
- type SystemType
- type ValveState
Constants ¶
const ( AuthTypeUsernamePassword = 1 AuthTypeXAuthToken = 2 AuthTypeBearerToken = 3 ReadTimeout = 5 )
const ( STARTING = "Starting" RUNNING = "Running" RUNNINGWOTEL = "Running Only Alerts" TELNOTFOUND = "Telemetry Service Not Found" CONNFAILED = "Connection Failed" LEAKED = "Leak Detected" MONITORING = "Monitoring" )
Service states
const ( SHUTDOWNRECEIVED = "Shutdown Received" SHUTDOWNFAILED = "Shutdown Failed" POWERSTATEON = "Power Status On" POWERSTATEOFF = "Power Status Off" )
ServiceItem states
const ( UNKNOWN = disc.UNKNOWN MSM = disc.MSM EC = disc.EC IDRAC = disc.IDRAC IRC = disc.IRC NVLINK = disc.NVLINK )
const ( RESEND = "resend" ADDSERVICE = "addservice" DELETESERVICE = "deleteservice" UPDATESERVICE = "updateservice" GETSERVICE = "getservice" UPDATELOGIN = "updatelogin" TERMINATE = "terminate" SPLUNKADDHEC = "splunkaddhec" GETHECCONFIG = "gethecconfig" GETALLSERVICES = "getallservices" ADDSERVICEITEM = "addserviceitem" DELETESERVICEITEM = "deleteserviceitem" GETSERVICEITEMS = "getserviceitems" GETSERVICEITEM = "getserviceitem" UPDATESERVICEITEM = "updateserviceitem" UPDATEVALVESTATE = "updatevalvestate" GETVALVESTATE = "getvalvestatus" ADDSYSTEMTYPE = "addsystemtype" GETSYSTEMTYPES = "getsystemtypes" GETLOGIN = "getlogin" UPDATESERVICEX = "updateservicex" // Message type for services SERVICE = "service" )
const ( CommandQueue = "/queue/authorization/command" EventQueue = "/queue/authorization" ReplyPrefix = "/queue/authorization/reply." )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthClientInterface ¶
type AuthClientInterface interface {
AddService(service Service) error
AddServiceItem(si ServiceItem) error
DeleteService(service Service) error
DeleteServiceItem(si ServiceItem) error
GetHECConfig()
GetAllServices() []Service
GetService(ctx context.Context, services chan<- *Service)
GetServiceItems(sip string) []ServiceItem
GetServiceWithIP(ip string) Service
GetServiceItemWithIP(siip string) ServiceItem
ResendAll()
SplunkAddHEC(SplunkHttp SplunkConfig) error
UpdateServiceX(s Service) error
UpdateService(s Service) error
UpdateServiceItem(si ServiceItem) error
UpdateServiceItemState(state string, siip string) error
UpdateServiceState(state string, sip string) error
UpdateServiceXState(state string, ip string) error
UpdateValveState(ip string, state1 string, state2 string) error
UpdateLogin(l Login) error
AddSystemType(sysType string) error
GetAllSystemTypes() []SystemType
GetLogin() Login
}
type AuthorizationClient ¶
type AuthorizationClient struct {
*service.BaseClient
}
func NewAuthorizationClient ¶
func NewAuthorizationClient(bus messagebus.Messagebus, clientName string) *AuthorizationClient
NewAuthorizationClient creates a new AuthorizationClient with the given message bus
func (*AuthorizationClient) AddService ¶
func (ac *AuthorizationClient) AddService(service Service) error
AddService sends a fire-and-forget request to add a service
func (*AuthorizationClient) AddServiceItem ¶
func (ac *AuthorizationClient) AddServiceItem(si ServiceItem) error
AddServiceItem sends a fire-and-forget request to add a service item
func (*AuthorizationClient) AddSystemType ¶
func (ac *AuthorizationClient) AddSystemType(sysType string) error
AddSystemType sends a fire-and-forget request to add a system type
func (*AuthorizationClient) DeleteService ¶
func (ac *AuthorizationClient) DeleteService(service Service) error
DeleteService sends a fire-and-forget request to delete a service
func (*AuthorizationClient) DeleteServiceItem ¶
func (ac *AuthorizationClient) DeleteServiceItem(si ServiceItem) error
DeleteServiceItem sends a fire-and-forget request to delete a service item
func (*AuthorizationClient) GetAllServices ¶
func (ac *AuthorizationClient) GetAllServices() []Service
GetAllServices retrieves all configured services using request/reply.
func (*AuthorizationClient) GetAllSystemTypes ¶
func (ac *AuthorizationClient) GetAllSystemTypes() []SystemType
GetAllSystemTypes retrieves all configured system types using request/reply.
func (*AuthorizationClient) GetHECConfig ¶
func (ac *AuthorizationClient) GetHECConfig()
GetHECConfig sends a fire-and-forget request to get HEC config
func (*AuthorizationClient) GetLogin ¶
func (ac *AuthorizationClient) GetLogin() Login
func (*AuthorizationClient) GetService ¶
func (ac *AuthorizationClient) GetService(ctx context.Context, services chan<- *Service)
GetService listens for Service broadcasts on EventQueue. The ctx parameter allows cancellation of the listener.
func (*AuthorizationClient) GetServiceItemWithIP ¶
func (ac *AuthorizationClient) GetServiceItemWithIP(siip string) ServiceItem
GetServiceItemWithIP retrieves exactly one service item by IP using request/reply.
func (*AuthorizationClient) GetServiceItems ¶
func (ac *AuthorizationClient) GetServiceItems(sip string) []ServiceItem
GetServiceItems retrieves the associated systems for a service IP using request/reply.
func (*AuthorizationClient) GetServiceWithIP ¶
func (ac *AuthorizationClient) GetServiceWithIP(ip string) Service
GetServiceWithIP retrieves one service by IP using request/reply.
func (*AuthorizationClient) GetValveStatus ¶
func (ac *AuthorizationClient) GetValveStatus() []ValveState
GetValveStatus retrieves the current valve status using request/reply.
func (*AuthorizationClient) ResendAll ¶
func (ac *AuthorizationClient) ResendAll()
ResendAll sends a fire-and-forget request to resend all services
func (*AuthorizationClient) SplunkAddHEC ¶
func (ac *AuthorizationClient) SplunkAddHEC(splunkHttp SplunkConfig) error
SplunkAddHEC sends a fire-and-forget request to add Splunk HEC config
func (*AuthorizationClient) UpdateLogin ¶
func (ac *AuthorizationClient) UpdateLogin(l Login) error
UpdateLogin sends a fire-and-forget request to update login credentials
func (*AuthorizationClient) UpdateService ¶
func (ac *AuthorizationClient) UpdateService(s Service) error
UpdateService sends a fire-and-forget request to update a service
func (*AuthorizationClient) UpdateServiceItem ¶
func (ac *AuthorizationClient) UpdateServiceItem(si ServiceItem) error
UpdateServiceItem sends a fire-and-forget request to update a service item
func (*AuthorizationClient) UpdateServiceItemState ¶
func (ac *AuthorizationClient) UpdateServiceItemState(state string, siip string) error
func (*AuthorizationClient) UpdateServiceState ¶
func (ac *AuthorizationClient) UpdateServiceState(state string, sip string) error
func (*AuthorizationClient) UpdateServiceX ¶
func (ac *AuthorizationClient) UpdateServiceX(s Service) error
UpdateServiceX sends a fire-and-forget request to update a service (extended)
func (*AuthorizationClient) UpdateServiceXState ¶
func (ac *AuthorizationClient) UpdateServiceXState(state string, ip string) error
func (*AuthorizationClient) UpdateValveState ¶
func (ac *AuthorizationClient) UpdateValveState(ip string, state1 string, state2 string) error
UpdateValveState sends a fire-and-forget request to update valve state
type AuthorizationService ¶
type AuthorizationService struct {
*service.BaseService
}
func NewAuthorizationService ¶
func NewAuthorizationService(bus messagebus.Messagebus) *AuthorizationService
NewAuthorizationService creates a new AuthorizationService with the given message bus
func (*AuthorizationService) BroadcastService ¶
func (as *AuthorizationService) BroadcastService(svc Service) error
BroadcastService broadcasts a service update to EventQueue using envelope format
type Command ¶
type Command struct {
Command string `json:"command"`
SplunkConfig SplunkConfig `json:"Splunkconfig,omitempty"`
Service Service `json:"service,omitempty"`
ServiceItem ServiceItem `json:"serviceitem,omitempty"`
ReceiveQueue string `json:"receivequeue,omitempty"`
SystemType SystemType `json:"systemtype,omitempty"`
ValveState ValveState `json:"valvestate,omitempty"`
Login Login `json:"login,omitempty"`
}
type Service ¶
type ServiceItem ¶
type ServiceItem struct {
Service
ServiceIP string `json:"serviceIp"`
Systemtypedesc string `json:"systemtypedesc"`
IsForcefulshutdown bool `json:"isforcefulshutdown"`
Timeout int `json:"timeout"`
}
func (ServiceItem) String ¶
func (si ServiceItem) String() string
type SplunkConfig ¶
type SystemType ¶
type SystemType string