| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 | package mq// MqClient - type for taking in an MQ client's datatype MqClient struct {	ID       string	Text     string	Password string	Networks []string}// ModifyClient - modifies an existing client's network rolesfunc ModifyClient(client *MqClient) error {	roles := []MqDynSecRole{		{			Rolename: HostRole,			Priority: -1,		},	}	for i := range client.Networks {		roles = append(roles, MqDynSecRole{			Rolename: client.Networks[i],			Priority: -1,		},		)	}	event := MqDynsecPayload{		Commands: []MqDynSecCmd{			{				Command:  ModifyClientCmd,				Username: client.ID,				Textname: client.Text,				Roles:    roles,				Groups:   make([]MqDynSecGroup, 0),			},		},	}	return publishEventToDynSecTopic(event)}// DeleteMqClient - removes a client from the DynSec systemfunc DeleteMqClient(hostID string) error {	event := MqDynsecPayload{		Commands: []MqDynSecCmd{			{				Command:  DeleteClientCmd,				Username: hostID,			},		},	}	return publishEventToDynSecTopic(event)}// CreateMqClient - creates an MQ DynSec clientfunc CreateMqClient(client *MqClient) error {	roles := []MqDynSecRole{		{			Rolename: HostRole,			Priority: -1,		},	}	for i := range client.Networks {		roles = append(roles, MqDynSecRole{			Rolename: client.Networks[i],			Priority: -1,		},		)	}	event := MqDynsecPayload{		Commands: []MqDynSecCmd{			{				Command:  CreateClientCmd,				Username: client.ID,				Password: client.Password,				Textname: client.Text,				Roles:    roles,				Groups:   make([]MqDynSecGroup, 0),			},		},	}	return publishEventToDynSecTopic(event)}
 |