示例#1
0
func (t *rpcType) ConfigureSubs(conn *srpc.Conn,
	request dominator.ConfigureSubsRequest,
	reply *dominator.ConfigureSubsResponse) error {
	if conn.Username() == "" {
		t.logger.Printf("ConfigureSubs()\n")
	} else {
		t.logger.Printf("ConfigureSubs(): by %s\n", conn.Username())
	}
	return t.herd.ConfigureSubs(sub.Configuration(request))
}
示例#2
0
func getSubsConfiguration(client *srpc.Client) error {
	var request dominator.GetSubsConfigurationRequest
	var reply dominator.GetSubsConfigurationResponse
	if err := client.RequestReply("Dominator.GetSubsConfiguration", request,
		&reply); err != nil {
		return err
	}
	fmt.Println(sub.Configuration(reply))
	return nil
}
示例#3
0
func getConfiguration(client *srpc.Client) (sub.Configuration, error) {
	var request sub.GetConfigurationRequest
	var reply sub.GetConfigurationResponse
	err := client.RequestReply("Subd.GetConfiguration", request, &reply)
	return sub.Configuration(reply), err
}