text
stringlengths
1
1.05M
#pragma once #include "php_uv_cb.h" #include "php_uv_classes.h" #include "php_uv_debug.h" #include "php_uv_error.h" #include "php_uv_loop.h" #include "php_uv_param.h"
from sklearn.cluster import KMeans import numpy as np #create array of data points data_points = np.array([[0, 0], [5, 5], [10, 10], [15, 15], [20, 20]]) # Build and fit model kmeans = KMeans(n_clusters=2).fit(data_points) # Predict clusters labels = kmeans.predict(data_points) # Label data points labels_mapped = lables.tolist() label_dict = dict(zip(data_points.tolist(),labels_mapped)) # Print result for data_point, label in label_dict.items(): print("Data point:", data_point, ", Label:", label)
<filename>peony-core/src/main/java/com/peony/core/data/tx/PrepareCachedData.java package com.peony.core.data.tx; import com.peony.core.data.OperType; /** * @Author: zhengyuzhen * @Date: 2019-08-28 09:38 */ public class PrepareCachedData { private OperType operType; // TODO 这个key,如果更新可以的话,是更新之后的数据的key,而不是,更新之前的key,在校验时会有问题,更新缓存的地方也要看下!要改成更新之前的key!!!! private String key; private Object data; public OperType getOperType() { return operType; } public void setOperType(OperType operType) { this.operType = operType; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public Object getData() { return data; } public void setData(Object data) { this.data = data; } }
#!/bin/bash cd /usr/share/grafana.tungstenfabric grafana-server -config /etc/grafana.tungstenfabric/grafana.ini cfg:default.paths.data=/var/lib/grafana.tungstenfabric 1>/var/log/grafana.tungstenfabric.log 2>&1
<reponame>larshelge/httpcomponents-core /* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.hc.core5.http.impl.bootstrap; import java.io.IOException; import java.net.SocketAddress; import java.util.Set; import java.util.concurrent.Future; import org.apache.hc.core5.annotation.Internal; import org.apache.hc.core5.concurrent.DefaultThreadFactory; import org.apache.hc.core5.concurrent.FutureCallback; import org.apache.hc.core5.function.Callback; import org.apache.hc.core5.function.Decorator; import org.apache.hc.core5.io.CloseMode; import org.apache.hc.core5.reactor.ConnectionAcceptor; import org.apache.hc.core5.reactor.ConnectionInitiator; import org.apache.hc.core5.reactor.DefaultListeningIOReactor; import org.apache.hc.core5.reactor.IOEventHandlerFactory; import org.apache.hc.core5.reactor.IOReactorConfig; import org.apache.hc.core5.reactor.IOReactorService; import org.apache.hc.core5.reactor.IOReactorStatus; import org.apache.hc.core5.reactor.IOSession; import org.apache.hc.core5.reactor.IOSessionListener; import org.apache.hc.core5.reactor.ListenerEndpoint; import org.apache.hc.core5.util.TimeValue; /** * Protocol agnostic server side I/O session handler. */ public class AsyncServer extends AbstractConnectionInitiatorBase implements IOReactorService, ConnectionAcceptor { private final DefaultListeningIOReactor ioReactor; @Internal public AsyncServer( final IOEventHandlerFactory eventHandlerFactory, final IOReactorConfig ioReactorConfig, final Decorator<IOSession> ioSessionDecorator, final Callback<Exception> exceptionCallback, final IOSessionListener sessionListener, final Callback<IOSession> sessionShutdownCallback) { this.ioReactor = new DefaultListeningIOReactor( eventHandlerFactory, ioReactorConfig, new DefaultThreadFactory("server-dispatch", true), new DefaultThreadFactory("server-listener", true), ioSessionDecorator, exceptionCallback, sessionListener, sessionShutdownCallback); } @Override public void start() { ioReactor.start(); } @Override ConnectionInitiator getIOReactor() { return ioReactor; } public Future<ListenerEndpoint> listen( final SocketAddress address, final Object attachment, final FutureCallback<ListenerEndpoint> callback) { return ioReactor.listen(address, attachment, callback); } @Override public Future<ListenerEndpoint> listen(final SocketAddress address, final FutureCallback<ListenerEndpoint> callback) { return listen(address, null, callback); } public Future<ListenerEndpoint> listen(final SocketAddress address) { return ioReactor.listen(address, null); } @Override public void pause() throws IOException { ioReactor.pause(); } @Override public void resume() throws IOException { ioReactor.resume(); } @Override public Set<ListenerEndpoint> getEndpoints() { return ioReactor.getEndpoints(); } @Override public IOReactorStatus getStatus() { return ioReactor.getStatus(); } @Override public void initiateShutdown() { ioReactor.initiateShutdown(); } @Override public void awaitShutdown(final TimeValue waitTime) throws InterruptedException { ioReactor.awaitShutdown(waitTime); } @Override public void close(final CloseMode closeMode) { ioReactor.close(closeMode); } @Override public void close() throws IOException { ioReactor.close(); } }
import { toMilliSatsFromNumber, toSats } from "@domain/bitcoin" import { WalletInvoiceFactory } from "@domain/wallet-invoices/wallet-invoice-factory" let walletInvoiceFactory: WalletInvoiceFactory beforeAll(async () => { walletInvoiceFactory = WalletInvoiceFactory("id" as WalletId) }) describe("wallet invoice factory methods", () => { it("translates a registered invoice to wallet invoice", () => { const registeredInvoice: RegisteredInvoice = { invoice: { paymentHash: "paymentHash" as PaymentHash, paymentSecret: "paymentSecret" as PaymentSecret, paymentRequest: "paymentRequest" as EncodedPaymentRequest, routeHints: [], cltvDelta: null, destination: "destination" as Pubkey, amount: toSats(42), milliSatsAmount: toMilliSatsFromNumber(42000), description: "", features: [], }, pubkey: "pubkey" as Pubkey, } const result = walletInvoiceFactory.create({ registeredInvoice }) const expected = { paymentHash: "paymentHash", walletId: "id", selfGenerated: true, pubkey: "pubkey", paid: false, } expect(result).toEqual(expected) }) it("translates a registered invoice to wallet invoice for a recipient", () => { const registeredInvoice = { invoice: { paymentHash: "paymentHash" as PaymentHash, paymentSecret: "paymentSecret" as PaymentSecret, paymentRequest: "paymentRequest" as EncodedPaymentRequest, }, pubkey: "pubkey" as Pubkey, } const result = walletInvoiceFactory.createForRecipient({ registeredInvoice }) const expected = { paymentHash: "paymentHash", walletId: "id", selfGenerated: false, pubkey: "pubkey", paid: false, } expect(result).toEqual(expected) }) })
<filename>Shared/UUToolbox/UUImageView.h // // UUImageView.h // Useful Utilities - UIImageView extensions // // (c) 2013, <NAME>. All Rights Reserved. // // Smile License: // You are free to use this code for whatever purposes you desire. The only requirement is that you smile everytime you use it. // // Contact: @cheesemaker or <EMAIL> #import <UIKit/UIKit.h> @protocol UUImageCache @required - (id)objectForKey:(id)key; - (void) setObject:(id)object forKey:(id)key; @end @interface UIImageView (UURemoteLoading) - (void) uuLoadImageFromURL:(NSURL*)url defaultImage:(UIImage*)defaultImage loadCompleteHandler:(void (^)(UIImageView* imageView))loadCompleteHandler; + (void) uuSetImageCache:(NSObject*)cache; @end
def wordCount(sentence, word): word_count = 0 words = sentence.split(" ") for w in words: if w == word: word_count += 1 return word_count sentence = 'the quick brown fox, the' word = 'the' count = wordCount(sentence, word) print("Number of occurrence of 'the':",count)
require "rails_helper" RSpec.describe ConcreteSlotDecorator do let(:visit) { create(:visit) } let(:slot_errors) { [] } let(:nomis_checker) do double(StaffNomisChecker, errors_for: slot_errors, prisoner_availability_unknown?: false, slot_availability_unknown?: false ) end let(:date) { Date.tomorrow } let(:slot) do ConcreteSlot.new(date.year, date.month, date.day, 14, 0, 15, 30) end subject do described_class.decorate(slot, context: { index: 0, visit: visit }) end before do subject.h.output_buffer = "" allow(subject).to receive(:nomis_checker).and_return(nomis_checker) end describe '#slot_picker' do let(:form_builder) do ActionView::Helpers::FormBuilder.new(:visit, visit, subject.h, {}) end let(:html_fragment) do subject.slot_picker(form_builder) Capybara.string(h.output_buffer) end describe 'prisoner availability' do context 'when the api is enabled' do context 'with a closed restriction' do let(:slot_errors) { [Nomis::Restriction::CLOSED_NAME] } it 'renders the checkbox with errors' do expect(html_fragment).to have_css('label.date-box__label.date-box--error') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_css('span.tag--verified', text: 'Prisoner available') expect(html_fragment).to have_css('span.tag--error', text: 'Closed visit restriction') expect(html_fragment).to have_css('input.js-closedRestriction') expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") end end context 'when a prisoner is available' do it 'renders the checkbox without errors ' do expect(html_fragment).to have_css('label.date-box__label') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") expect(html_fragment).not_to have_css("input[disabled='disabled']") end end context 'when a prisoner is not available' do context 'with a date in the future' do let(:slot_errors) { ['external_movement'] } it 'renders the checkbox with errors' do expect(html_fragment).to have_css('label.date-box__label.date-box--error') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") expect(html_fragment).to have_css('span.tag--error', text: 'Prisoner on movement') end end context 'when it is a date in the past' do let(:date) { Date.yesterday } it 'renders the checkbox neither verified or errors' do expect(html_fragment).to have_css('label.date-box__label') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") expect(html_fragment).not_to have_css('span.tag--error') expect(html_fragment).not_to have_css('span.tag--verified') end end end end context 'when the api is disabled' do before do switch_off_api end it 'renders the checkbox without errors' do expect(html_fragment).to have_css('label.date-box__label') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") end end end describe 'slot availability' do context 'when the api is enabled' do before do switch_on :nomis_staff_slot_availability_enabled switch_feature_flag_with(:staff_prisons_with_slot_availability, [visit.prison_name]) end context 'when a slot is available' do it 'renders the checkbox' do expect(html_fragment).to have_css('label.date-box__label') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") end end context 'when a slot is not available' do context 'with a date in the future' do let(:slot_errors) { ['slot_not_available'] } it 'renders the checkbox' do expect(html_fragment).to have_css('label.date-box__label.date-box--error') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") expect(html_fragment).to have_css('span.tag--error', text: 'Fully booked') end end context 'with a date in the past' do let(:date) { Date.yesterday } it 'renders the checkbox neither verified or errors' do expect(html_fragment).to have_css('label.date-box__label.disabled') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") expect(html_fragment).to have_css("input[disabled='disabled']") expect(html_fragment).not_to have_css('span.tag--error') expect(html_fragment).not_to have_css('span.tag--verified') end end end end context 'when the api is disabled' do before do switch_off :nomis_staff_slot_availability_enabled switch_feature_flag_with(:staff_prisons_with_slot_availability, [visit.prison_name]) end it 'renders the checkbox without errors' do expect(html_fragment).to have_css('label.date-box__label') expect(html_fragment).to have_css('span.date-box__day', text: date.strftime('%A')) expect(html_fragment).to have_text("#{slot.to_date.strftime('%d %b %Y')} 14:00–15:30") end end end end describe '#bookable?' do context 'when the prisoner is avaliable' do context 'when the slot is not avaliable' do before do switch_on :nomis_staff_slot_availability_enabled switch_feature_flag_with(:staff_prisons_with_slot_availability, [visit.prison_name]) end let(:slot_errors) { ['slot_not_available'] } it { expect(subject).not_to be_bookable } end context 'when the slot is avaliable' do before do switch_on :nomis_staff_slot_availability_enabled switch_feature_flag_with(:staff_prisons_with_slot_availability, [visit.prison_name]) end it { expect(subject).to be_bookable } end end context 'when the prisoner is not avaliable' do let(:slot_errors) { ['external_movement'] } context 'when the slot is avaliable' do before do switch_on :nomis_staff_slot_availability_enabled switch_feature_flag_with(:staff_prisons_with_slot_availability, [visit.prison_name]) end it { expect(subject).not_to be_bookable } end end end end
<reponame>jaafarbarek/pyrtos<filename>micropython-1.5/py/parse.h /* * This file is part of the Micro Python project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2013, 2014 <NAME> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef __MICROPY_INCLUDED_PY_PARSE_H__ #define __MICROPY_INCLUDED_PY_PARSE_H__ #include <stdint.h> #include "py/mpconfig.h" struct _mp_lexer_t; // a mp_parse_node_t is: // - 0000...0000: no node // - xxxx...xxx1: a small integer; bits 1 and above are the signed value, 2's complement // - xxxx...xx00: pointer to mp_parse_node_struct_t // - xx...xx0010: an identifier; bits 4 and above are the qstr // - xx...xx0110: a string; bits 4 and above are the qstr holding the value // - xx...xx1010: a string of bytes; bits 4 and above are the qstr holding the value // - xx...xx1110: a token; bits 4 and above are mp_token_kind_t #define MP_PARSE_NODE_NULL (0) #define MP_PARSE_NODE_SMALL_INT (0x1) #define MP_PARSE_NODE_ID (0x02) #define MP_PARSE_NODE_STRING (0x06) #define MP_PARSE_NODE_BYTES (0x0a) #define MP_PARSE_NODE_TOKEN (0x0e) typedef mp_uint_t mp_parse_node_t; // must be pointer size typedef struct _mp_parse_node_struct_t { uint32_t source_line; // line number in source file uint32_t kind_num_nodes; // parse node kind, and number of nodes mp_parse_node_t nodes[]; // nodes } mp_parse_node_struct_t; // macros for mp_parse_node_t usage // some of these evaluate their argument more than once #define MP_PARSE_NODE_IS_NULL(pn) ((pn) == MP_PARSE_NODE_NULL) #define MP_PARSE_NODE_IS_LEAF(pn) ((pn) & 3) #define MP_PARSE_NODE_IS_STRUCT(pn) ((pn) != MP_PARSE_NODE_NULL && ((pn) & 3) == 0) #define MP_PARSE_NODE_IS_STRUCT_KIND(pn, k) ((pn) != MP_PARSE_NODE_NULL && ((pn) & 3) == 0 && MP_PARSE_NODE_STRUCT_KIND((mp_parse_node_struct_t*)(pn)) == (k)) #define MP_PARSE_NODE_IS_SMALL_INT(pn) (((pn) & 0x1) == MP_PARSE_NODE_SMALL_INT) #define MP_PARSE_NODE_IS_ID(pn) (((pn) & 0x0f) == MP_PARSE_NODE_ID) #define MP_PARSE_NODE_IS_TOKEN(pn) (((pn) & 0x0f) == MP_PARSE_NODE_TOKEN) #define MP_PARSE_NODE_IS_TOKEN_KIND(pn, k) ((pn) == (MP_PARSE_NODE_TOKEN | ((k) << 4))) #define MP_PARSE_NODE_LEAF_KIND(pn) ((pn) & 0x0f) #define MP_PARSE_NODE_LEAF_ARG(pn) (((mp_uint_t)(pn)) >> 4) #define MP_PARSE_NODE_LEAF_SMALL_INT(pn) (((mp_int_t)(pn)) >> 1) #define MP_PARSE_NODE_STRUCT_KIND(pns) ((pns)->kind_num_nodes & 0xff) #define MP_PARSE_NODE_STRUCT_NUM_NODES(pns) ((pns)->kind_num_nodes >> 8) mp_parse_node_t mp_parse_node_new_leaf(mp_int_t kind, mp_int_t arg); int mp_parse_node_extract_list(mp_parse_node_t *pn, mp_uint_t pn_kind, mp_parse_node_t **nodes); void mp_parse_node_print(mp_parse_node_t pn, mp_uint_t indent); typedef enum { MP_PARSE_SINGLE_INPUT, MP_PARSE_FILE_INPUT, MP_PARSE_EVAL_INPUT, } mp_parse_input_kind_t; typedef struct _mp_parse_t { mp_parse_node_t root; struct _mp_parse_chunk_t *chunk; } mp_parse_tree_t; // the parser will raise an exception if an error occurred // the parser will free the lexer before it returns mp_parse_tree_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind); void mp_parse_tree_clear(mp_parse_tree_t *tree); #endif // __MICROPY_INCLUDED_PY_PARSE_H__
// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: lorawan-stack/api/packetbrokeragent.proto package ttnpb import ( context "context" fmt "fmt" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" _ "github.com/envoyproxy/protoc-gen-validate/validate" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" golang_proto "github.com/golang/protobuf/proto" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = golang_proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type PacketBrokerNetworkIdentifier struct { // LoRa Alliance NetID. NetID uint32 `protobuf:"varint,1,opt,name=net_id,json=netId,proto3" json:"net_id,omitempty"` // Tenant identifier if the registration leases DevAddr blocks from a NetID. TenantId string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerNetworkIdentifier) Reset() { *m = PacketBrokerNetworkIdentifier{} } func (*PacketBrokerNetworkIdentifier) ProtoMessage() {} func (*PacketBrokerNetworkIdentifier) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{0} } func (m *PacketBrokerNetworkIdentifier) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerNetworkIdentifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerNetworkIdentifier.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerNetworkIdentifier) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerNetworkIdentifier.Merge(m, src) } func (m *PacketBrokerNetworkIdentifier) XXX_Size() int { return m.Size() } func (m *PacketBrokerNetworkIdentifier) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerNetworkIdentifier.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerNetworkIdentifier proto.InternalMessageInfo func (m *PacketBrokerNetworkIdentifier) GetNetID() uint32 { if m != nil { return m.NetID } return 0 } func (m *PacketBrokerNetworkIdentifier) GetTenantId() string { if m != nil { return m.TenantId } return "" } type PacketBrokerDevAddrBlock struct { DevAddrPrefix *DevAddrPrefix `protobuf:"bytes,1,opt,name=dev_addr_prefix,json=devAddrPrefix,proto3" json:"dev_addr_prefix,omitempty"` HomeNetworkClusterID string `protobuf:"bytes,2,opt,name=home_network_cluster_id,json=homeNetworkClusterId,proto3" json:"home_network_cluster_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerDevAddrBlock) Reset() { *m = PacketBrokerDevAddrBlock{} } func (*PacketBrokerDevAddrBlock) ProtoMessage() {} func (*PacketBrokerDevAddrBlock) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{1} } func (m *PacketBrokerDevAddrBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerDevAddrBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerDevAddrBlock.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerDevAddrBlock) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerDevAddrBlock.Merge(m, src) } func (m *PacketBrokerDevAddrBlock) XXX_Size() int { return m.Size() } func (m *PacketBrokerDevAddrBlock) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerDevAddrBlock.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerDevAddrBlock proto.InternalMessageInfo func (m *PacketBrokerDevAddrBlock) GetDevAddrPrefix() *DevAddrPrefix { if m != nil { return m.DevAddrPrefix } return nil } func (m *PacketBrokerDevAddrBlock) GetHomeNetworkClusterID() string { if m != nil { return m.HomeNetworkClusterID } return "" } type PacketBrokerNetwork struct { // Packet Broker network identifier. Id *PacketBrokerNetworkIdentifier `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Name of the network. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // DevAddr blocks that are assigned to this registration. DevAddrBlocks []*PacketBrokerDevAddrBlock `protobuf:"bytes,3,rep,name=dev_addr_blocks,json=devAddrBlocks,proto3" json:"dev_addr_blocks,omitempty"` // Contact information. ContactInfo []*ContactInfo `protobuf:"bytes,4,rep,name=contact_info,json=contactInfo,proto3" json:"contact_info,omitempty"` // Whether the network is listed so it can be viewed by other networks. Listed bool `protobuf:"varint,5,opt,name=listed,proto3" json:"listed,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerNetwork) Reset() { *m = PacketBrokerNetwork{} } func (*PacketBrokerNetwork) ProtoMessage() {} func (*PacketBrokerNetwork) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{2} } func (m *PacketBrokerNetwork) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerNetwork) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerNetwork.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerNetwork) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerNetwork.Merge(m, src) } func (m *PacketBrokerNetwork) XXX_Size() int { return m.Size() } func (m *PacketBrokerNetwork) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerNetwork.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerNetwork proto.InternalMessageInfo func (m *PacketBrokerNetwork) GetId() *PacketBrokerNetworkIdentifier { if m != nil { return m.Id } return nil } func (m *PacketBrokerNetwork) GetName() string { if m != nil { return m.Name } return "" } func (m *PacketBrokerNetwork) GetDevAddrBlocks() []*PacketBrokerDevAddrBlock { if m != nil { return m.DevAddrBlocks } return nil } func (m *PacketBrokerNetwork) GetContactInfo() []*ContactInfo { if m != nil { return m.ContactInfo } return nil } func (m *PacketBrokerNetwork) GetListed() bool { if m != nil { return m.Listed } return false } type PacketBrokerNetworks struct { Networks []*PacketBrokerNetwork `protobuf:"bytes,1,rep,name=networks,proto3" json:"networks,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerNetworks) Reset() { *m = PacketBrokerNetworks{} } func (*PacketBrokerNetworks) ProtoMessage() {} func (*PacketBrokerNetworks) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{3} } func (m *PacketBrokerNetworks) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerNetworks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerNetworks.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerNetworks) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerNetworks.Merge(m, src) } func (m *PacketBrokerNetworks) XXX_Size() int { return m.Size() } func (m *PacketBrokerNetworks) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerNetworks.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerNetworks proto.InternalMessageInfo func (m *PacketBrokerNetworks) GetNetworks() []*PacketBrokerNetwork { if m != nil { return m.Networks } return nil } type PacketBrokerInfo struct { // The current registration, unset if there isn't a registration. Registration *PacketBrokerNetwork `protobuf:"bytes,1,opt,name=registration,proto3" json:"registration,omitempty"` // Whether the server is configured as Forwarder (with gateways). ForwarderEnabled bool `protobuf:"varint,2,opt,name=forwarder_enabled,json=forwarderEnabled,proto3" json:"forwarder_enabled,omitempty"` // Whether the server is configured as Home Network (with end devices). HomeNetworkEnabled bool `protobuf:"varint,3,opt,name=home_network_enabled,json=homeNetworkEnabled,proto3" json:"home_network_enabled,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerInfo) Reset() { *m = PacketBrokerInfo{} } func (*PacketBrokerInfo) ProtoMessage() {} func (*PacketBrokerInfo) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{4} } func (m *PacketBrokerInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerInfo.Merge(m, src) } func (m *PacketBrokerInfo) XXX_Size() int { return m.Size() } func (m *PacketBrokerInfo) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerInfo.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerInfo proto.InternalMessageInfo func (m *PacketBrokerInfo) GetRegistration() *PacketBrokerNetwork { if m != nil { return m.Registration } return nil } func (m *PacketBrokerInfo) GetForwarderEnabled() bool { if m != nil { return m.ForwarderEnabled } return false } func (m *PacketBrokerInfo) GetHomeNetworkEnabled() bool { if m != nil { return m.HomeNetworkEnabled } return false } type PacketBrokerRoutingPolicyUplink struct { // Forward join-request messages. JoinRequest bool `protobuf:"varint,1,opt,name=join_request,json=joinRequest,proto3" json:"join_request,omitempty"` // Forward uplink messages with FPort of 0. MacData bool `protobuf:"varint,2,opt,name=mac_data,json=macData,proto3" json:"mac_data,omitempty"` // Forward uplink messages with FPort between 1 and 255. ApplicationData bool `protobuf:"varint,3,opt,name=application_data,json=applicationData,proto3" json:"application_data,omitempty"` // Forward RSSI and SNR. SignalQuality bool `protobuf:"varint,4,opt,name=signal_quality,json=signalQuality,proto3" json:"signal_quality,omitempty"` // Forward gateway location, RSSI, SNR and fine timestamp. Localization bool `protobuf:"varint,5,opt,name=localization,proto3" json:"localization,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerRoutingPolicyUplink) Reset() { *m = PacketBrokerRoutingPolicyUplink{} } func (*PacketBrokerRoutingPolicyUplink) ProtoMessage() {} func (*PacketBrokerRoutingPolicyUplink) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{5} } func (m *PacketBrokerRoutingPolicyUplink) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerRoutingPolicyUplink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerRoutingPolicyUplink.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerRoutingPolicyUplink) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerRoutingPolicyUplink.Merge(m, src) } func (m *PacketBrokerRoutingPolicyUplink) XXX_Size() int { return m.Size() } func (m *PacketBrokerRoutingPolicyUplink) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerRoutingPolicyUplink.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerRoutingPolicyUplink proto.InternalMessageInfo func (m *PacketBrokerRoutingPolicyUplink) GetJoinRequest() bool { if m != nil { return m.JoinRequest } return false } func (m *PacketBrokerRoutingPolicyUplink) GetMacData() bool { if m != nil { return m.MacData } return false } func (m *PacketBrokerRoutingPolicyUplink) GetApplicationData() bool { if m != nil { return m.ApplicationData } return false } func (m *PacketBrokerRoutingPolicyUplink) GetSignalQuality() bool { if m != nil { return m.SignalQuality } return false } func (m *PacketBrokerRoutingPolicyUplink) GetLocalization() bool { if m != nil { return m.Localization } return false } type PacketBrokerRoutingPolicyDownlink struct { // Allow join-accept messages. JoinAccept bool `protobuf:"varint,1,opt,name=join_accept,json=joinAccept,proto3" json:"join_accept,omitempty"` // Allow downlink messages with FPort of 0. MacData bool `protobuf:"varint,2,opt,name=mac_data,json=macData,proto3" json:"mac_data,omitempty"` // Allow downlink messages with FPort between 1 and 255. ApplicationData bool `protobuf:"varint,3,opt,name=application_data,json=applicationData,proto3" json:"application_data,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerRoutingPolicyDownlink) Reset() { *m = PacketBrokerRoutingPolicyDownlink{} } func (*PacketBrokerRoutingPolicyDownlink) ProtoMessage() {} func (*PacketBrokerRoutingPolicyDownlink) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{6} } func (m *PacketBrokerRoutingPolicyDownlink) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerRoutingPolicyDownlink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerRoutingPolicyDownlink.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerRoutingPolicyDownlink) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerRoutingPolicyDownlink.Merge(m, src) } func (m *PacketBrokerRoutingPolicyDownlink) XXX_Size() int { return m.Size() } func (m *PacketBrokerRoutingPolicyDownlink) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerRoutingPolicyDownlink.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerRoutingPolicyDownlink proto.InternalMessageInfo func (m *PacketBrokerRoutingPolicyDownlink) GetJoinAccept() bool { if m != nil { return m.JoinAccept } return false } func (m *PacketBrokerRoutingPolicyDownlink) GetMacData() bool { if m != nil { return m.MacData } return false } func (m *PacketBrokerRoutingPolicyDownlink) GetApplicationData() bool { if m != nil { return m.ApplicationData } return false } type PacketBrokerDefaultRoutingPolicy struct { // Timestamp when the policy got last updated. UpdatedAt *types.Timestamp `protobuf:"bytes,1,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Uplink policy. Uplink *PacketBrokerRoutingPolicyUplink `protobuf:"bytes,2,opt,name=uplink,proto3" json:"uplink,omitempty"` // Downlink policy. Downlink *PacketBrokerRoutingPolicyDownlink `protobuf:"bytes,3,opt,name=downlink,proto3" json:"downlink,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerDefaultRoutingPolicy) Reset() { *m = PacketBrokerDefaultRoutingPolicy{} } func (*PacketBrokerDefaultRoutingPolicy) ProtoMessage() {} func (*PacketBrokerDefaultRoutingPolicy) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{7} } func (m *PacketBrokerDefaultRoutingPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerDefaultRoutingPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerDefaultRoutingPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerDefaultRoutingPolicy) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerDefaultRoutingPolicy.Merge(m, src) } func (m *PacketBrokerDefaultRoutingPolicy) XXX_Size() int { return m.Size() } func (m *PacketBrokerDefaultRoutingPolicy) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerDefaultRoutingPolicy.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerDefaultRoutingPolicy proto.InternalMessageInfo func (m *PacketBrokerDefaultRoutingPolicy) GetUpdatedAt() *types.Timestamp { if m != nil { return m.UpdatedAt } return nil } func (m *PacketBrokerDefaultRoutingPolicy) GetUplink() *PacketBrokerRoutingPolicyUplink { if m != nil { return m.Uplink } return nil } func (m *PacketBrokerDefaultRoutingPolicy) GetDownlink() *PacketBrokerRoutingPolicyDownlink { if m != nil { return m.Downlink } return nil } type PacketBrokerRoutingPolicy struct { // Packet Broker identifier of the Forwarder. ForwarderId *PacketBrokerNetworkIdentifier `protobuf:"bytes,1,opt,name=forwarder_id,json=forwarderId,proto3" json:"forwarder_id,omitempty"` // Packet Broker identifier of the Home Network. HomeNetworkId *PacketBrokerNetworkIdentifier `protobuf:"bytes,2,opt,name=home_network_id,json=homeNetworkId,proto3" json:"home_network_id,omitempty"` // Timestamp when the policy got last updated. UpdatedAt *types.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // Uplink policy. Uplink *PacketBrokerRoutingPolicyUplink `protobuf:"bytes,4,opt,name=uplink,proto3" json:"uplink,omitempty"` // Downlink policy. Downlink *PacketBrokerRoutingPolicyDownlink `protobuf:"bytes,5,opt,name=downlink,proto3" json:"downlink,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerRoutingPolicy) Reset() { *m = PacketBrokerRoutingPolicy{} } func (*PacketBrokerRoutingPolicy) ProtoMessage() {} func (*PacketBrokerRoutingPolicy) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{8} } func (m *PacketBrokerRoutingPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerRoutingPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerRoutingPolicy.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerRoutingPolicy) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerRoutingPolicy.Merge(m, src) } func (m *PacketBrokerRoutingPolicy) XXX_Size() int { return m.Size() } func (m *PacketBrokerRoutingPolicy) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerRoutingPolicy.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerRoutingPolicy proto.InternalMessageInfo func (m *PacketBrokerRoutingPolicy) GetForwarderId() *PacketBrokerNetworkIdentifier { if m != nil { return m.ForwarderId } return nil } func (m *PacketBrokerRoutingPolicy) GetHomeNetworkId() *PacketBrokerNetworkIdentifier { if m != nil { return m.HomeNetworkId } return nil } func (m *PacketBrokerRoutingPolicy) GetUpdatedAt() *types.Timestamp { if m != nil { return m.UpdatedAt } return nil } func (m *PacketBrokerRoutingPolicy) GetUplink() *PacketBrokerRoutingPolicyUplink { if m != nil { return m.Uplink } return nil } func (m *PacketBrokerRoutingPolicy) GetDownlink() *PacketBrokerRoutingPolicyDownlink { if m != nil { return m.Downlink } return nil } type SetPacketBrokerDefaultRoutingPolicyRequest struct { // Uplink policy. Uplink *PacketBrokerRoutingPolicyUplink `protobuf:"bytes,1,opt,name=uplink,proto3" json:"uplink,omitempty"` // Downlink policy. Downlink *PacketBrokerRoutingPolicyDownlink `protobuf:"bytes,2,opt,name=downlink,proto3" json:"downlink,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) Reset() { *m = SetPacketBrokerDefaultRoutingPolicyRequest{} } func (*SetPacketBrokerDefaultRoutingPolicyRequest) ProtoMessage() {} func (*SetPacketBrokerDefaultRoutingPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{9} } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SetPacketBrokerDefaultRoutingPolicyRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_SetPacketBrokerDefaultRoutingPolicyRequest.Merge(m, src) } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) XXX_Size() int { return m.Size() } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) XXX_DiscardUnknown() { xxx_messageInfo_SetPacketBrokerDefaultRoutingPolicyRequest.DiscardUnknown(m) } var xxx_messageInfo_SetPacketBrokerDefaultRoutingPolicyRequest proto.InternalMessageInfo func (m *SetPacketBrokerDefaultRoutingPolicyRequest) GetUplink() *PacketBrokerRoutingPolicyUplink { if m != nil { return m.Uplink } return nil } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) GetDownlink() *PacketBrokerRoutingPolicyDownlink { if m != nil { return m.Downlink } return nil } type ListHomeNetworkRoutingPoliciesRequest struct { // Limit the number of results per page. Limit uint32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` // Page number for pagination. 0 is interpreted as 1. Page uint32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListHomeNetworkRoutingPoliciesRequest) Reset() { *m = ListHomeNetworkRoutingPoliciesRequest{} } func (*ListHomeNetworkRoutingPoliciesRequest) ProtoMessage() {} func (*ListHomeNetworkRoutingPoliciesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{10} } func (m *ListHomeNetworkRoutingPoliciesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListHomeNetworkRoutingPoliciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListHomeNetworkRoutingPoliciesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListHomeNetworkRoutingPoliciesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListHomeNetworkRoutingPoliciesRequest.Merge(m, src) } func (m *ListHomeNetworkRoutingPoliciesRequest) XXX_Size() int { return m.Size() } func (m *ListHomeNetworkRoutingPoliciesRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListHomeNetworkRoutingPoliciesRequest.DiscardUnknown(m) } var xxx_messageInfo_ListHomeNetworkRoutingPoliciesRequest proto.InternalMessageInfo func (m *ListHomeNetworkRoutingPoliciesRequest) GetLimit() uint32 { if m != nil { return m.Limit } return 0 } func (m *ListHomeNetworkRoutingPoliciesRequest) GetPage() uint32 { if m != nil { return m.Page } return 0 } type PacketBrokerRoutingPolicies struct { Policies []*PacketBrokerRoutingPolicy `protobuf:"bytes,1,rep,name=policies,proto3" json:"policies,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PacketBrokerRoutingPolicies) Reset() { *m = PacketBrokerRoutingPolicies{} } func (*PacketBrokerRoutingPolicies) ProtoMessage() {} func (*PacketBrokerRoutingPolicies) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{11} } func (m *PacketBrokerRoutingPolicies) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PacketBrokerRoutingPolicies) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PacketBrokerRoutingPolicies.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PacketBrokerRoutingPolicies) XXX_Merge(src proto.Message) { xxx_messageInfo_PacketBrokerRoutingPolicies.Merge(m, src) } func (m *PacketBrokerRoutingPolicies) XXX_Size() int { return m.Size() } func (m *PacketBrokerRoutingPolicies) XXX_DiscardUnknown() { xxx_messageInfo_PacketBrokerRoutingPolicies.DiscardUnknown(m) } var xxx_messageInfo_PacketBrokerRoutingPolicies proto.InternalMessageInfo func (m *PacketBrokerRoutingPolicies) GetPolicies() []*PacketBrokerRoutingPolicy { if m != nil { return m.Policies } return nil } type SetPacketBrokerRoutingPolicyRequest struct { // Packet Broker identifier of the Home Network. HomeNetworkId *PacketBrokerNetworkIdentifier `protobuf:"bytes,1,opt,name=home_network_id,json=homeNetworkId,proto3" json:"home_network_id,omitempty"` // Uplink policy. Uplink *PacketBrokerRoutingPolicyUplink `protobuf:"bytes,2,opt,name=uplink,proto3" json:"uplink,omitempty"` // Downlink policy. Downlink *PacketBrokerRoutingPolicyDownlink `protobuf:"bytes,3,opt,name=downlink,proto3" json:"downlink,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SetPacketBrokerRoutingPolicyRequest) Reset() { *m = SetPacketBrokerRoutingPolicyRequest{} } func (*SetPacketBrokerRoutingPolicyRequest) ProtoMessage() {} func (*SetPacketBrokerRoutingPolicyRequest) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{12} } func (m *SetPacketBrokerRoutingPolicyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SetPacketBrokerRoutingPolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SetPacketBrokerRoutingPolicyRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *SetPacketBrokerRoutingPolicyRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_SetPacketBrokerRoutingPolicyRequest.Merge(m, src) } func (m *SetPacketBrokerRoutingPolicyRequest) XXX_Size() int { return m.Size() } func (m *SetPacketBrokerRoutingPolicyRequest) XXX_DiscardUnknown() { xxx_messageInfo_SetPacketBrokerRoutingPolicyRequest.DiscardUnknown(m) } var xxx_messageInfo_SetPacketBrokerRoutingPolicyRequest proto.InternalMessageInfo func (m *SetPacketBrokerRoutingPolicyRequest) GetHomeNetworkId() *PacketBrokerNetworkIdentifier { if m != nil { return m.HomeNetworkId } return nil } func (m *SetPacketBrokerRoutingPolicyRequest) GetUplink() *PacketBrokerRoutingPolicyUplink { if m != nil { return m.Uplink } return nil } func (m *SetPacketBrokerRoutingPolicyRequest) GetDownlink() *PacketBrokerRoutingPolicyDownlink { if m != nil { return m.Downlink } return nil } type ListPacketBrokerNetworksRequest struct { // Limit the number of results per page. Limit uint32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` // Page number for pagination. 0 is interpreted as 1. Page uint32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // If true, list only the Forwarders and Home Networks with whom a routing policy has been defined in either direction. WithRoutingPolicy bool `protobuf:"varint,3,opt,name=with_routing_policy,json=withRoutingPolicy,proto3" json:"with_routing_policy,omitempty"` // Filter by tenant ID. TenantIdContains string `protobuf:"bytes,4,opt,name=tenant_id_contains,json=tenantIdContains,proto3" json:"tenant_id_contains,omitempty"` // Filter by name. NameContains string `protobuf:"bytes,5,opt,name=name_contains,json=nameContains,proto3" json:"name_contains,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListPacketBrokerNetworksRequest) Reset() { *m = ListPacketBrokerNetworksRequest{} } func (*ListPacketBrokerNetworksRequest) ProtoMessage() {} func (*ListPacketBrokerNetworksRequest) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{13} } func (m *ListPacketBrokerNetworksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListPacketBrokerNetworksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListPacketBrokerNetworksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListPacketBrokerNetworksRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListPacketBrokerNetworksRequest.Merge(m, src) } func (m *ListPacketBrokerNetworksRequest) XXX_Size() int { return m.Size() } func (m *ListPacketBrokerNetworksRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListPacketBrokerNetworksRequest.DiscardUnknown(m) } var xxx_messageInfo_ListPacketBrokerNetworksRequest proto.InternalMessageInfo func (m *ListPacketBrokerNetworksRequest) GetLimit() uint32 { if m != nil { return m.Limit } return 0 } func (m *ListPacketBrokerNetworksRequest) GetPage() uint32 { if m != nil { return m.Page } return 0 } func (m *ListPacketBrokerNetworksRequest) GetWithRoutingPolicy() bool { if m != nil { return m.WithRoutingPolicy } return false } func (m *ListPacketBrokerNetworksRequest) GetTenantIdContains() string { if m != nil { return m.TenantIdContains } return "" } func (m *ListPacketBrokerNetworksRequest) GetNameContains() string { if m != nil { return m.NameContains } return "" } type ListPacketBrokerHomeNetworksRequest struct { // Limit the number of results per page. Limit uint32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` // Page number for pagination. 0 is interpreted as 1. Page uint32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // Filter by tenant ID. TenantIdContains string `protobuf:"bytes,3,opt,name=tenant_id_contains,json=tenantIdContains,proto3" json:"tenant_id_contains,omitempty"` // Filter by name. NameContains string `protobuf:"bytes,4,opt,name=name_contains,json=nameContains,proto3" json:"name_contains,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListPacketBrokerHomeNetworksRequest) Reset() { *m = ListPacketBrokerHomeNetworksRequest{} } func (*ListPacketBrokerHomeNetworksRequest) ProtoMessage() {} func (*ListPacketBrokerHomeNetworksRequest) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{14} } func (m *ListPacketBrokerHomeNetworksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListPacketBrokerHomeNetworksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListPacketBrokerHomeNetworksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListPacketBrokerHomeNetworksRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListPacketBrokerHomeNetworksRequest.Merge(m, src) } func (m *ListPacketBrokerHomeNetworksRequest) XXX_Size() int { return m.Size() } func (m *ListPacketBrokerHomeNetworksRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListPacketBrokerHomeNetworksRequest.DiscardUnknown(m) } var xxx_messageInfo_ListPacketBrokerHomeNetworksRequest proto.InternalMessageInfo func (m *ListPacketBrokerHomeNetworksRequest) GetLimit() uint32 { if m != nil { return m.Limit } return 0 } func (m *ListPacketBrokerHomeNetworksRequest) GetPage() uint32 { if m != nil { return m.Page } return 0 } func (m *ListPacketBrokerHomeNetworksRequest) GetTenantIdContains() string { if m != nil { return m.TenantIdContains } return "" } func (m *ListPacketBrokerHomeNetworksRequest) GetNameContains() string { if m != nil { return m.NameContains } return "" } type ListForwarderRoutingPoliciesRequest struct { // Packet Broker identifier of the Home Network. HomeNetworkId *PacketBrokerNetworkIdentifier `protobuf:"bytes,1,opt,name=home_network_id,json=homeNetworkId,proto3" json:"home_network_id,omitempty"` // Limit the number of results per page. Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` // Page number for pagination. 0 is interpreted as 1. Page uint32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListForwarderRoutingPoliciesRequest) Reset() { *m = ListForwarderRoutingPoliciesRequest{} } func (*ListForwarderRoutingPoliciesRequest) ProtoMessage() {} func (*ListForwarderRoutingPoliciesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_1a44242dc5cd678e, []int{15} } func (m *ListForwarderRoutingPoliciesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListForwarderRoutingPoliciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListForwarderRoutingPoliciesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListForwarderRoutingPoliciesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListForwarderRoutingPoliciesRequest.Merge(m, src) } func (m *ListForwarderRoutingPoliciesRequest) XXX_Size() int { return m.Size() } func (m *ListForwarderRoutingPoliciesRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListForwarderRoutingPoliciesRequest.DiscardUnknown(m) } var xxx_messageInfo_ListForwarderRoutingPoliciesRequest proto.InternalMessageInfo func (m *ListForwarderRoutingPoliciesRequest) GetHomeNetworkId() *PacketBrokerNetworkIdentifier { if m != nil { return m.HomeNetworkId } return nil } func (m *ListForwarderRoutingPoliciesRequest) GetLimit() uint32 { if m != nil { return m.Limit } return 0 } func (m *ListForwarderRoutingPoliciesRequest) GetPage() uint32 { if m != nil { return m.Page } return 0 } func init() { proto.RegisterType((*PacketBrokerNetworkIdentifier)(nil), "ttn.lorawan.v3.PacketBrokerNetworkIdentifier") golang_proto.RegisterType((*PacketBrokerNetworkIdentifier)(nil), "ttn.lorawan.v3.PacketBrokerNetworkIdentifier") proto.RegisterType((*PacketBrokerDevAddrBlock)(nil), "ttn.lorawan.v3.PacketBrokerDevAddrBlock") golang_proto.RegisterType((*PacketBrokerDevAddrBlock)(nil), "ttn.lorawan.v3.PacketBrokerDevAddrBlock") proto.RegisterType((*PacketBrokerNetwork)(nil), "ttn.lorawan.v3.PacketBrokerNetwork") golang_proto.RegisterType((*PacketBrokerNetwork)(nil), "ttn.lorawan.v3.PacketBrokerNetwork") proto.RegisterType((*PacketBrokerNetworks)(nil), "ttn.lorawan.v3.PacketBrokerNetworks") golang_proto.RegisterType((*PacketBrokerNetworks)(nil), "ttn.lorawan.v3.PacketBrokerNetworks") proto.RegisterType((*PacketBrokerInfo)(nil), "ttn.lorawan.v3.PacketBrokerInfo") golang_proto.RegisterType((*PacketBrokerInfo)(nil), "ttn.lorawan.v3.PacketBrokerInfo") proto.RegisterType((*PacketBrokerRoutingPolicyUplink)(nil), "ttn.lorawan.v3.PacketBrokerRoutingPolicyUplink") golang_proto.RegisterType((*PacketBrokerRoutingPolicyUplink)(nil), "ttn.lorawan.v3.PacketBrokerRoutingPolicyUplink") proto.RegisterType((*PacketBrokerRoutingPolicyDownlink)(nil), "ttn.lorawan.v3.PacketBrokerRoutingPolicyDownlink") golang_proto.RegisterType((*PacketBrokerRoutingPolicyDownlink)(nil), "ttn.lorawan.v3.PacketBrokerRoutingPolicyDownlink") proto.RegisterType((*PacketBrokerDefaultRoutingPolicy)(nil), "ttn.lorawan.v3.PacketBrokerDefaultRoutingPolicy") golang_proto.RegisterType((*PacketBrokerDefaultRoutingPolicy)(nil), "ttn.lorawan.v3.PacketBrokerDefaultRoutingPolicy") proto.RegisterType((*PacketBrokerRoutingPolicy)(nil), "ttn.lorawan.v3.PacketBrokerRoutingPolicy") golang_proto.RegisterType((*PacketBrokerRoutingPolicy)(nil), "ttn.lorawan.v3.PacketBrokerRoutingPolicy") proto.RegisterType((*SetPacketBrokerDefaultRoutingPolicyRequest)(nil), "ttn.lorawan.v3.SetPacketBrokerDefaultRoutingPolicyRequest") golang_proto.RegisterType((*SetPacketBrokerDefaultRoutingPolicyRequest)(nil), "ttn.lorawan.v3.SetPacketBrokerDefaultRoutingPolicyRequest") proto.RegisterType((*ListHomeNetworkRoutingPoliciesRequest)(nil), "ttn.lorawan.v3.ListHomeNetworkRoutingPoliciesRequest") golang_proto.RegisterType((*ListHomeNetworkRoutingPoliciesRequest)(nil), "ttn.lorawan.v3.ListHomeNetworkRoutingPoliciesRequest") proto.RegisterType((*PacketBrokerRoutingPolicies)(nil), "ttn.lorawan.v3.PacketBrokerRoutingPolicies") golang_proto.RegisterType((*PacketBrokerRoutingPolicies)(nil), "ttn.lorawan.v3.PacketBrokerRoutingPolicies") proto.RegisterType((*SetPacketBrokerRoutingPolicyRequest)(nil), "ttn.lorawan.v3.SetPacketBrokerRoutingPolicyRequest") golang_proto.RegisterType((*SetPacketBrokerRoutingPolicyRequest)(nil), "ttn.lorawan.v3.SetPacketBrokerRoutingPolicyRequest") proto.RegisterType((*ListPacketBrokerNetworksRequest)(nil), "ttn.lorawan.v3.ListPacketBrokerNetworksRequest") golang_proto.RegisterType((*ListPacketBrokerNetworksRequest)(nil), "ttn.lorawan.v3.ListPacketBrokerNetworksRequest") proto.RegisterType((*ListPacketBrokerHomeNetworksRequest)(nil), "ttn.lorawan.v3.ListPacketBrokerHomeNetworksRequest") golang_proto.RegisterType((*ListPacketBrokerHomeNetworksRequest)(nil), "ttn.lorawan.v3.ListPacketBrokerHomeNetworksRequest") proto.RegisterType((*ListForwarderRoutingPoliciesRequest)(nil), "ttn.lorawan.v3.ListForwarderRoutingPoliciesRequest") golang_proto.RegisterType((*ListForwarderRoutingPoliciesRequest)(nil), "ttn.lorawan.v3.ListForwarderRoutingPoliciesRequest") } func init() { proto.RegisterFile("lorawan-stack/api/packetbrokeragent.proto", fileDescriptor_1a44242dc5cd678e) } func init() { golang_proto.RegisterFile("lorawan-stack/api/packetbrokeragent.proto", fileDescriptor_1a44242dc5cd678e) } var fileDescriptor_1a44242dc5cd678e = []byte{ // 1806 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4d, 0x6c, 0x1b, 0xc7, 0x15, 0xe6, 0x90, 0xa2, 0x4d, 0x3d, 0x4a, 0x91, 0x34, 0x56, 0x53, 0x9a, 0x8a, 0x57, 0xf4, 0x4a, 0x42, 0x65, 0x39, 0x24, 0x5d, 0xba, 0x39, 0xd8, 0x40, 0x6b, 0x98, 0x96, 0xab, 0xaa, 0xa8, 0x5d, 0x79, 0x5d, 0xc7, 0x85, 0x8c, 0x84, 0x1d, 0xee, 0x8e, 0xa8, 0xad, 0x96, 0xbb, 0x9b, 0xdd, 0xa1, 0x14, 0xc5, 0x31, 0x10, 0x14, 0x3d, 0xa4, 0x39, 0x15, 0x2d, 0xd0, 0x16, 0xe8, 0xa5, 0x08, 0xd0, 0xc2, 0xb9, 0x05, 0x3d, 0x05, 0x3d, 0x14, 0xb9, 0x14, 0x48, 0x6f, 0x41, 0x8b, 0x02, 0xee, 0x25, 0x88, 0xc8, 0x1e, 0x8c, 0x9e, 0x72, 0x29, 0x10, 0xf8, 0x54, 0xec, 0xec, 0x2c, 0xb9, 0xfc, 0xd5, 0x4a, 0x72, 0x6e, 0xbb, 0x33, 0xef, 0x3d, 0x7e, 0xdf, 0xf7, 0xde, 0xbc, 0x79, 0x4b, 0xb8, 0x60, 0x58, 0x0e, 0xd9, 0x23, 0x66, 0xde, 0x65, 0x44, 0xdd, 0x29, 0x12, 0x5b, 0x2f, 0xda, 0x44, 0xdd, 0xa1, 0xac, 0xea, 0x58, 0x3b, 0xd4, 0x21, 0x35, 0x6a, 0xb2, 0x82, 0xed, 0x58, 0xcc, 0xc2, 0x2f, 0x30, 0x66, 0x16, 0x84, 0x79, 0x61, 0xf7, 0x72, 0xf6, 0x7a, 0x4d, 0x67, 0xdb, 0x8d, 0x6a, 0x41, 0xb5, 0xea, 0x45, 0x6a, 0xee, 0x5a, 0xfb, 0xb6, 0x63, 0xbd, 0xb9, 0x5f, 0xe4, 0xc6, 0x6a, 0xbe, 0x46, 0xcd, 0xfc, 0x2e, 0x31, 0x74, 0x8d, 0x30, 0x5a, 0xec, 0x7b, 0xf0, 0x43, 0x66, 0xf3, 0xa1, 0x10, 0x35, 0xab, 0x66, 0xf9, 0xce, 0xd5, 0xc6, 0x16, 0x7f, 0xe3, 0x2f, 0xfc, 0x49, 0x98, 0xbf, 0x54, 0xb3, 0xac, 0x9a, 0x41, 0x39, 0x4a, 0x62, 0x9a, 0x16, 0x23, 0x4c, 0xb7, 0x4c, 0x57, 0xec, 0xce, 0x89, 0xdd, 0x76, 0x0c, 0x5a, 0xb7, 0xd9, 0xbe, 0xd8, 0x9c, 0xef, 0xdd, 0x64, 0x7a, 0x9d, 0xba, 0x8c, 0xd4, 0x6d, 0x61, 0xb0, 0xd8, 0x2f, 0x84, 0x6a, 0x99, 0x8c, 0xa8, 0xac, 0xa2, 0x9b, 0x5b, 0x01, 0x02, 0xb9, 0xdf, 0x8a, 0x9a, 0x5a, 0x45, 0xa3, 0xbb, 0xba, 0x1a, 0x90, 0xca, 0xf5, 0xdb, 0xd4, 0xa9, 0xeb, 0x92, 0x1a, 0x15, 0x48, 0xe5, 0xf7, 0x10, 0x9c, 0xdb, 0xe0, 0x2a, 0x97, 0xb9, 0xca, 0xb7, 0x29, 0xdb, 0xb3, 0x9c, 0x9d, 0x75, 0x8d, 0x9a, 0x4c, 0xdf, 0xd2, 0xa9, 0x83, 0x73, 0x70, 0xca, 0xa4, 0xac, 0xa2, 0x6b, 0x19, 0x94, 0x43, 0xcb, 0x93, 0xe5, 0xf1, 0xe6, 0x67, 0xf3, 0xc9, 0xdb, 0x94, 0xad, 0xaf, 0x2a, 0x49, 0x93, 0xb2, 0x75, 0x0d, 0xaf, 0xc1, 0x38, 0xa3, 0x26, 0x31, 0xb9, 0x51, 0x3c, 0x87, 0x96, 0xc7, 0xcb, 0x2b, 0xcf, 0xca, 0xdf, 0x70, 0x96, 0x32, 0x8b, 0xa5, 0xf3, 0xaf, 0x3f, 0x20, 0xf9, 0xb7, 0x2e, 0xe5, 0xaf, 0xbc, 0xb6, 0x7c, 0xed, 0xea, 0x83, 0xfc, 0x6b, 0xd7, 0x82, 0xd7, 0x0b, 0x0f, 0x4b, 0x2f, 0x3f, 0x5a, 0x7c, 0xfb, 0xf5, 0x45, 0x25, 0xe5, 0x3b, 0xaf, 0x6b, 0xf2, 0x9f, 0x11, 0x64, 0xc2, 0x60, 0x56, 0xe9, 0xee, 0x75, 0x4d, 0x73, 0xca, 0x86, 0xa5, 0xee, 0xe0, 0x9b, 0x30, 0xa5, 0xd1, 0xdd, 0x0a, 0xd1, 0x34, 0xa7, 0x62, 0x3b, 0x74, 0x4b, 0x7f, 0x93, 0x03, 0x4a, 0x97, 0xce, 0x15, 0xba, 0xab, 0xa1, 0x20, 0xdc, 0x36, 0xb8, 0x91, 0x32, 0xa9, 0x85, 0x5f, 0xf1, 0x0f, 0xe1, 0xeb, 0xdb, 0x56, 0x9d, 0x56, 0x4c, 0x9f, 0x68, 0x45, 0x35, 0x1a, 0x2e, 0xa3, 0x4e, 0x07, 0x7a, 0xa6, 0xf9, 0xd9, 0xfc, 0xec, 0xf7, 0xac, 0x3a, 0x15, 0x52, 0xdc, 0xf0, 0x0d, 0xd6, 0x57, 0x95, 0xd9, 0xed, 0xfe, 0x55, 0x4d, 0xfe, 0x55, 0x1c, 0xce, 0x0c, 0x50, 0x10, 0x7f, 0x1b, 0xe2, 0x42, 0xb3, 0x74, 0x29, 0xdf, 0x0b, 0x71, 0xa4, 0xe4, 0x4a, 0x5c, 0xd7, 0x30, 0x86, 0x31, 0x93, 0xd4, 0xa9, 0x0f, 0x4a, 0xe1, 0xcf, 0x78, 0x23, 0x24, 0x41, 0xd5, 0x13, 0xc5, 0xcd, 0x24, 0x72, 0x89, 0xe5, 0x74, 0x69, 0x79, 0x54, 0xfc, 0xb0, 0x8a, 0x6d, 0x35, 0xf8, 0x9b, 0x8b, 0xbf, 0x03, 0x13, 0xe1, 0xd2, 0xca, 0x8c, 0xf1, 0x70, 0x73, 0xbd, 0xe1, 0x6e, 0xf8, 0x36, 0xeb, 0xe6, 0x96, 0xa5, 0xa4, 0xd5, 0xce, 0x0b, 0x7e, 0x11, 0x4e, 0x19, 0xba, 0xcb, 0xa8, 0x96, 0x49, 0xe6, 0xd0, 0x72, 0x4a, 0x11, 0x6f, 0xf2, 0x7d, 0x98, 0x1d, 0x40, 0xd1, 0xc5, 0xd7, 0x20, 0x25, 0x84, 0x77, 0x33, 0x88, 0xff, 0xd6, 0x42, 0x04, 0x69, 0x94, 0xb6, 0x93, 0xfc, 0x17, 0x04, 0xd3, 0x61, 0x0b, 0x8e, 0x62, 0x0d, 0x26, 0x1c, 0x5a, 0xd3, 0x5d, 0xe6, 0xf0, 0x53, 0x28, 0x44, 0x8f, 0x14, 0xb9, 0xcb, 0x11, 0x5f, 0x84, 0x99, 0x2d, 0xcb, 0xd9, 0x23, 0x8e, 0x46, 0x9d, 0x0a, 0x35, 0x49, 0xd5, 0xa0, 0x7e, 0x59, 0xa4, 0x94, 0xe9, 0xf6, 0xc6, 0x4d, 0x7f, 0x1d, 0x5f, 0x82, 0xd9, 0xae, 0x4a, 0x0a, 0xec, 0x13, 0xdc, 0x1e, 0x87, 0x8a, 0x45, 0x78, 0xc8, 0xff, 0x42, 0x30, 0x1f, 0x06, 0xa1, 0x58, 0x0d, 0xa6, 0x9b, 0xb5, 0x0d, 0xcb, 0xd0, 0xd5, 0xfd, 0x7b, 0xb6, 0xa1, 0x9b, 0x3b, 0xf8, 0x3c, 0x4c, 0xfc, 0xd4, 0xd2, 0xcd, 0x8a, 0x43, 0xdf, 0x68, 0x50, 0x97, 0x71, 0x2e, 0x29, 0x25, 0xed, 0xad, 0x29, 0xfe, 0x12, 0x3e, 0x0b, 0xa9, 0x3a, 0x51, 0x2b, 0x1a, 0x61, 0x44, 0x80, 0x3b, 0x5d, 0x27, 0xea, 0x2a, 0x61, 0x04, 0x5f, 0x80, 0x69, 0x62, 0xdb, 0x86, 0xae, 0x72, 0x3e, 0xbe, 0x89, 0x8f, 0x67, 0x2a, 0xb4, 0xce, 0x4d, 0x97, 0xe0, 0x05, 0x57, 0xaf, 0x99, 0xc4, 0xa8, 0xbc, 0xd1, 0x20, 0x86, 0xce, 0xf6, 0x33, 0x63, 0xdc, 0x70, 0xd2, 0x5f, 0xbd, 0xe3, 0x2f, 0x62, 0x19, 0x26, 0x0c, 0x4b, 0x25, 0x86, 0xfe, 0x96, 0xaf, 0xad, 0x9f, 0xe7, 0xae, 0x35, 0xaf, 0x89, 0x9c, 0x1f, 0xca, 0x6b, 0xd5, 0xda, 0x33, 0x39, 0xb3, 0x79, 0xe0, 0x2c, 0x2a, 0x44, 0x55, 0xa9, 0x1d, 0x10, 0x03, 0x6f, 0xe9, 0x3a, 0x5f, 0x79, 0x3e, 0xbc, 0xe4, 0xff, 0x21, 0xc8, 0x75, 0x97, 0xff, 0x16, 0x69, 0x18, 0xac, 0x0b, 0x13, 0xbe, 0x02, 0xd0, 0xb0, 0xbd, 0xee, 0xaf, 0x55, 0x08, 0x13, 0xf5, 0x92, 0x2d, 0xf8, 0x8d, 0xb9, 0x10, 0x34, 0xe6, 0xc2, 0x8f, 0x82, 0xc6, 0xac, 0x8c, 0x0b, 0xeb, 0xeb, 0x0c, 0xaf, 0xc1, 0xa9, 0x06, 0x4f, 0x15, 0xc7, 0x98, 0x2e, 0x15, 0x47, 0x95, 0xd9, 0x80, 0x0c, 0x2b, 0xc2, 0x1d, 0xdf, 0x82, 0x94, 0x26, 0xb4, 0xe1, 0x5c, 0xd2, 0xa5, 0x6f, 0x46, 0x0e, 0x15, 0x88, 0xaa, 0xb4, 0x43, 0xc8, 0xbf, 0x4d, 0xc0, 0xd9, 0xa1, 0xf6, 0x78, 0x03, 0x26, 0x3a, 0x95, 0x7d, 0xdc, 0xbe, 0x94, 0x6e, 0x87, 0x58, 0xd7, 0xf0, 0x3d, 0x98, 0xea, 0x2a, 0x7f, 0xd1, 0x40, 0x8f, 0x1c, 0x74, 0x32, 0x74, 0x50, 0xd6, 0xb5, 0x9e, 0xcc, 0x24, 0x8e, 0x97, 0x99, 0xb1, 0xe7, 0x97, 0x99, 0xe4, 0xc9, 0x33, 0xf3, 0x04, 0xc1, 0xca, 0x5d, 0xca, 0x0e, 0x2b, 0xca, 0xe0, 0x78, 0xdf, 0x69, 0xd3, 0x40, 0xc7, 0xa2, 0x51, 0x4e, 0x3d, 0x2b, 0x27, 0xdf, 0x43, 0xf1, 0x69, 0xd4, 0x26, 0x74, 0x3f, 0x44, 0x28, 0x7e, 0x4c, 0x42, 0xa1, 0xb0, 0x1d, 0x6a, 0x0f, 0x60, 0xe9, 0x07, 0xba, 0xcb, 0x42, 0xd7, 0x65, 0xd8, 0x57, 0xa7, 0x6e, 0x40, 0x4a, 0x82, 0xa4, 0xa1, 0xd7, 0x75, 0x26, 0x86, 0x08, 0x2f, 0xd6, 0x4a, 0x22, 0xf3, 0xf4, 0xb4, 0xe2, 0x2f, 0x7b, 0xd7, 0x9d, 0x4d, 0x6a, 0xfe, 0x75, 0x37, 0xa9, 0xf0, 0x67, 0x59, 0x83, 0xb9, 0x61, 0xa8, 0x74, 0xea, 0xe2, 0x9b, 0x90, 0xb2, 0xc5, 0xb3, 0xb8, 0x4b, 0x2e, 0x44, 0x26, 0xa5, 0xb4, 0x5d, 0xe5, 0xc7, 0x71, 0x58, 0xe8, 0xc9, 0xce, 0xc0, 0xb4, 0x0c, 0xa8, 0x77, 0xf4, 0x1c, 0xea, 0xfd, 0xce, 0x09, 0xdb, 0xc9, 0x21, 0xd9, 0x4e, 0x3c, 0xcf, 0x6c, 0xff, 0x17, 0xc1, 0xbc, 0x97, 0xee, 0x41, 0x57, 0xfb, 0x09, 0x12, 0x8d, 0x0b, 0x70, 0x66, 0x4f, 0x67, 0xdb, 0x15, 0xc7, 0x47, 0x52, 0xe1, 0xb9, 0xd9, 0x17, 0x0d, 0x7e, 0xc6, 0xdb, 0xea, 0x6e, 0x66, 0xaf, 0x00, 0x6e, 0x0f, 0x9c, 0x15, 0x3e, 0x8e, 0xe8, 0xa6, 0xcb, 0x0f, 0xfd, 0x78, 0xf9, 0xf4, 0xb3, 0xf2, 0x98, 0x13, 0xcf, 0x68, 0xca, 0x74, 0x30, 0x56, 0xde, 0x10, 0x06, 0xf8, 0x65, 0x98, 0xf4, 0xc6, 0xa8, 0x8e, 0x47, 0xb2, 0xdb, 0x63, 0xc2, 0xdb, 0x0d, 0xac, 0xe5, 0xbf, 0x22, 0x58, 0xe8, 0x25, 0x1b, 0xaa, 0xf3, 0x13, 0x11, 0x1e, 0x4c, 0x20, 0x71, 0x64, 0x02, 0x63, 0xa3, 0x08, 0xfc, 0x49, 0x10, 0xf8, 0x6e, 0xd0, 0xb4, 0x87, 0x1c, 0xcd, 0xaf, 0xa8, 0xb0, 0x67, 0x03, 0x5d, 0x7c, 0xe2, 0x3d, 0x6a, 0x24, 0x3a, 0x6a, 0x94, 0x5e, 0x85, 0xe4, 0x9a, 0xbb, 0x51, 0x25, 0xf8, 0x16, 0x4c, 0x6e, 0x34, 0xaa, 0x86, 0xee, 0x6e, 0x8b, 0x61, 0x68, 0xb1, 0x17, 0xc1, 0x1a, 0x61, 0x74, 0x8f, 0x88, 0xd2, 0xbf, 0xe5, 0x7f, 0xca, 0x64, 0x5f, 0xec, 0xbb, 0x1e, 0x6e, 0x7a, 0x9f, 0x5b, 0xa5, 0xbb, 0x90, 0xbc, 0xcd, 0xe3, 0x7e, 0x1f, 0xa6, 0x44, 0xdc, 0xce, 0x30, 0xd2, 0xf7, 0xd1, 0x20, 0x76, 0x0e, 0x0b, 0xfa, 0xb7, 0x19, 0x48, 0x78, 0x31, 0x5f, 0x85, 0xd3, 0x6b, 0x54, 0x0c, 0xc1, 0x83, 0x4d, 0xb3, 0xb9, 0x51, 0xfa, 0x79, 0x9e, 0xf2, 0xcc, 0xcf, 0xfe, 0xf9, 0x9f, 0x5f, 0xc7, 0xd3, 0x78, 0xbc, 0x68, 0x57, 0x49, 0xd1, 0x9b, 0xc0, 0xf1, 0x1e, 0xa4, 0x14, 0x3e, 0x92, 0x52, 0x67, 0x68, 0xe0, 0x28, 0x93, 0xad, 0x5c, 0xe0, 0xb1, 0x97, 0xb3, 0x33, 0x3c, 0x76, 0x78, 0xcc, 0xdd, 0x3c, 0x23, 0xf7, 0x2f, 0xe2, 0xfb, 0x00, 0xab, 0xd4, 0x39, 0xec, 0xa7, 0x87, 0xac, 0xcb, 0x67, 0xf9, 0xaf, 0x9d, 0x59, 0x19, 0x10, 0xf8, 0xf7, 0x08, 0xe4, 0x35, 0x1a, 0xbe, 0x23, 0x06, 0x8e, 0x64, 0xc3, 0x7e, 0xf1, 0xd2, 0xe8, 0x6f, 0x9b, 0xfe, 0x48, 0xf2, 0x45, 0x8e, 0x65, 0x09, 0x2f, 0x70, 0x2c, 0x5e, 0x55, 0xe6, 0x83, 0xef, 0x87, 0x62, 0xd0, 0xf6, 0x8b, 0x9a, 0xef, 0x89, 0xff, 0x81, 0x40, 0xbe, 0x7b, 0x38, 0xba, 0xab, 0xbd, 0x28, 0xa2, 0x5f, 0xe8, 0x43, 0x35, 0xfb, 0x31, 0xc7, 0xa9, 0x64, 0xa3, 0xe0, 0xbc, 0x8a, 0x56, 0x36, 0x97, 0xe5, 0x88, 0x96, 0xf8, 0xe7, 0x08, 0x96, 0x56, 0xa9, 0x41, 0x19, 0x3d, 0xae, 0xea, 0xc3, 0x30, 0x0b, 0x6d, 0x57, 0x22, 0x69, 0xfb, 0x01, 0x02, 0x69, 0xf4, 0x78, 0x80, 0x5f, 0xe9, 0xd5, 0x35, 0xd2, 0x38, 0x91, 0xbd, 0x18, 0xf5, 0x42, 0xf3, 0x6e, 0xf8, 0x05, 0x8e, 0xf9, 0x1c, 0x9e, 0x1b, 0x81, 0x19, 0xff, 0x1b, 0xc1, 0x5c, 0x77, 0x95, 0x76, 0x0b, 0x75, 0xb4, 0x66, 0x98, 0x8d, 0x3e, 0x8a, 0xc8, 0x3f, 0xe1, 0xf0, 0x36, 0xf1, 0xe2, 0x28, 0x49, 0x1f, 0xfa, 0xff, 0xc1, 0x3c, 0xda, 0x2c, 0xe1, 0x4b, 0x51, 0xec, 0x8a, 0x0f, 0xdb, 0x17, 0xcc, 0x23, 0xfc, 0x9b, 0x04, 0xcc, 0xdd, 0x1d, 0xc1, 0xed, 0xf2, 0x21, 0xc5, 0x7d, 0xa4, 0xaa, 0xfe, 0x20, 0xce, 0xf9, 0xbc, 0x1f, 0xcf, 0x7e, 0x6b, 0x24, 0xd0, 0x9e, 0x3b, 0xa7, 0x20, 0x80, 0x7b, 0x85, 0x7e, 0x45, 0x3e, 0xb6, 0xeb, 0xbd, 0xec, 0xc6, 0x71, 0x5c, 0xfb, 0x37, 0x3a, 0xf2, 0xf1, 0xb0, 0xf2, 0x57, 0x11, 0x16, 0xff, 0x1d, 0x81, 0xd4, 0x77, 0x4e, 0x4f, 0x54, 0x77, 0xc3, 0xb2, 0x22, 0x8a, 0x6c, 0x25, 0x62, 0x91, 0xad, 0x1c, 0xbd, 0xc8, 0xde, 0x86, 0x09, 0xef, 0xec, 0xb6, 0xff, 0xea, 0x29, 0x0e, 0x3a, 0xd9, 0x23, 0x26, 0xc7, 0xec, 0x62, 0x04, 0xa6, 0xae, 0xfc, 0x35, 0x4e, 0x64, 0x0a, 0x4f, 0x72, 0x80, 0x01, 0x36, 0xfc, 0x0b, 0x04, 0xd3, 0x3d, 0xad, 0xc3, 0xed, 0xaf, 0xeb, 0x08, 0xf3, 0x5c, 0x44, 0x18, 0x59, 0x0e, 0x63, 0x16, 0xe3, 0x7e, 0x9d, 0xf0, 0xfb, 0x08, 0x5e, 0x1a, 0x35, 0x78, 0x0d, 0xc6, 0x75, 0xc8, 0x98, 0x76, 0xb4, 0x96, 0x97, 0xe3, 0xf0, 0xb2, 0x38, 0xc3, 0xe1, 0xb5, 0x3f, 0xdb, 0x3b, 0x39, 0x2c, 0xff, 0x11, 0x7d, 0x72, 0x20, 0xa1, 0x4f, 0x0f, 0x24, 0xf4, 0xe4, 0x40, 0x8a, 0x7d, 0x7e, 0x20, 0xc5, 0x9e, 0x1e, 0x48, 0xb1, 0x2f, 0x0e, 0xa4, 0xd8, 0x97, 0x07, 0x12, 0x7a, 0xa7, 0x29, 0xa1, 0x77, 0x9b, 0x52, 0xec, 0x71, 0x53, 0x42, 0x1f, 0x36, 0xa5, 0xd8, 0x47, 0x4d, 0x29, 0xf6, 0x71, 0x53, 0x8a, 0x7d, 0xd2, 0x94, 0xd0, 0xa7, 0x4d, 0x09, 0x3d, 0x69, 0x4a, 0xb1, 0xcf, 0x9b, 0x12, 0x7a, 0xda, 0x94, 0x62, 0x5f, 0x34, 0x25, 0xf4, 0x65, 0x53, 0x8a, 0xbd, 0xd3, 0x92, 0x62, 0xef, 0xb6, 0x24, 0xf4, 0xcb, 0x96, 0x14, 0xfb, 0x5d, 0x4b, 0x42, 0x7f, 0x68, 0x49, 0xb1, 0xc7, 0x2d, 0x29, 0xf6, 0x61, 0x4b, 0x42, 0x1f, 0xb5, 0x24, 0xf4, 0x71, 0x4b, 0x42, 0x9b, 0xc5, 0x9a, 0x55, 0x60, 0xdb, 0x94, 0x6d, 0xeb, 0x66, 0xcd, 0x2d, 0x08, 0xc9, 0x8a, 0xdd, 0x7f, 0x53, 0xef, 0x5e, 0x2e, 0xda, 0x3b, 0xb5, 0x22, 0x63, 0xa6, 0x5d, 0xad, 0x9e, 0xe2, 0x85, 0x7c, 0xf9, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x54, 0x47, 0x25, 0x9f, 0x1e, 0x18, 0x00, 0x00, } func (this *PacketBrokerNetworkIdentifier) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerNetworkIdentifier) if !ok { that2, ok := that.(PacketBrokerNetworkIdentifier) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.NetID != that1.NetID { return false } if this.TenantId != that1.TenantId { return false } return true } func (this *PacketBrokerDevAddrBlock) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerDevAddrBlock) if !ok { that2, ok := that.(PacketBrokerDevAddrBlock) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.DevAddrPrefix.Equal(that1.DevAddrPrefix) { return false } if this.HomeNetworkClusterID != that1.HomeNetworkClusterID { return false } return true } func (this *PacketBrokerNetwork) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerNetwork) if !ok { that2, ok := that.(PacketBrokerNetwork) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Id.Equal(that1.Id) { return false } if this.Name != that1.Name { return false } if len(this.DevAddrBlocks) != len(that1.DevAddrBlocks) { return false } for i := range this.DevAddrBlocks { if !this.DevAddrBlocks[i].Equal(that1.DevAddrBlocks[i]) { return false } } if len(this.ContactInfo) != len(that1.ContactInfo) { return false } for i := range this.ContactInfo { if !this.ContactInfo[i].Equal(that1.ContactInfo[i]) { return false } } if this.Listed != that1.Listed { return false } return true } func (this *PacketBrokerNetworks) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerNetworks) if !ok { that2, ok := that.(PacketBrokerNetworks) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Networks) != len(that1.Networks) { return false } for i := range this.Networks { if !this.Networks[i].Equal(that1.Networks[i]) { return false } } return true } func (this *PacketBrokerInfo) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerInfo) if !ok { that2, ok := that.(PacketBrokerInfo) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Registration.Equal(that1.Registration) { return false } if this.ForwarderEnabled != that1.ForwarderEnabled { return false } if this.HomeNetworkEnabled != that1.HomeNetworkEnabled { return false } return true } func (this *PacketBrokerRoutingPolicyUplink) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerRoutingPolicyUplink) if !ok { that2, ok := that.(PacketBrokerRoutingPolicyUplink) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.JoinRequest != that1.JoinRequest { return false } if this.MacData != that1.MacData { return false } if this.ApplicationData != that1.ApplicationData { return false } if this.SignalQuality != that1.SignalQuality { return false } if this.Localization != that1.Localization { return false } return true } func (this *PacketBrokerRoutingPolicyDownlink) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerRoutingPolicyDownlink) if !ok { that2, ok := that.(PacketBrokerRoutingPolicyDownlink) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.JoinAccept != that1.JoinAccept { return false } if this.MacData != that1.MacData { return false } if this.ApplicationData != that1.ApplicationData { return false } return true } func (this *PacketBrokerDefaultRoutingPolicy) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerDefaultRoutingPolicy) if !ok { that2, ok := that.(PacketBrokerDefaultRoutingPolicy) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.UpdatedAt.Equal(that1.UpdatedAt) { return false } if !this.Uplink.Equal(that1.Uplink) { return false } if !this.Downlink.Equal(that1.Downlink) { return false } return true } func (this *PacketBrokerRoutingPolicy) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerRoutingPolicy) if !ok { that2, ok := that.(PacketBrokerRoutingPolicy) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.ForwarderId.Equal(that1.ForwarderId) { return false } if !this.HomeNetworkId.Equal(that1.HomeNetworkId) { return false } if !this.UpdatedAt.Equal(that1.UpdatedAt) { return false } if !this.Uplink.Equal(that1.Uplink) { return false } if !this.Downlink.Equal(that1.Downlink) { return false } return true } func (this *SetPacketBrokerDefaultRoutingPolicyRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*SetPacketBrokerDefaultRoutingPolicyRequest) if !ok { that2, ok := that.(SetPacketBrokerDefaultRoutingPolicyRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.Uplink.Equal(that1.Uplink) { return false } if !this.Downlink.Equal(that1.Downlink) { return false } return true } func (this *ListHomeNetworkRoutingPoliciesRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ListHomeNetworkRoutingPoliciesRequest) if !ok { that2, ok := that.(ListHomeNetworkRoutingPoliciesRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Limit != that1.Limit { return false } if this.Page != that1.Page { return false } return true } func (this *PacketBrokerRoutingPolicies) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*PacketBrokerRoutingPolicies) if !ok { that2, ok := that.(PacketBrokerRoutingPolicies) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if len(this.Policies) != len(that1.Policies) { return false } for i := range this.Policies { if !this.Policies[i].Equal(that1.Policies[i]) { return false } } return true } func (this *SetPacketBrokerRoutingPolicyRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*SetPacketBrokerRoutingPolicyRequest) if !ok { that2, ok := that.(SetPacketBrokerRoutingPolicyRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.HomeNetworkId.Equal(that1.HomeNetworkId) { return false } if !this.Uplink.Equal(that1.Uplink) { return false } if !this.Downlink.Equal(that1.Downlink) { return false } return true } func (this *ListPacketBrokerNetworksRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ListPacketBrokerNetworksRequest) if !ok { that2, ok := that.(ListPacketBrokerNetworksRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Limit != that1.Limit { return false } if this.Page != that1.Page { return false } if this.WithRoutingPolicy != that1.WithRoutingPolicy { return false } if this.TenantIdContains != that1.TenantIdContains { return false } if this.NameContains != that1.NameContains { return false } return true } func (this *ListPacketBrokerHomeNetworksRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ListPacketBrokerHomeNetworksRequest) if !ok { that2, ok := that.(ListPacketBrokerHomeNetworksRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.Limit != that1.Limit { return false } if this.Page != that1.Page { return false } if this.TenantIdContains != that1.TenantIdContains { return false } if this.NameContains != that1.NameContains { return false } return true } func (this *ListForwarderRoutingPoliciesRequest) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*ListForwarderRoutingPoliciesRequest) if !ok { that2, ok := that.(ListForwarderRoutingPoliciesRequest) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.HomeNetworkId.Equal(that1.HomeNetworkId) { return false } if this.Limit != that1.Limit { return false } if this.Page != that1.Page { return false } return true } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // GsPbaClient is the client API for GsPba service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type GsPbaClient interface { PublishUplink(ctx context.Context, in *GatewayUplinkMessage, opts ...grpc.CallOption) (*types.Empty, error) } type gsPbaClient struct { cc *grpc.ClientConn } func NewGsPbaClient(cc *grpc.ClientConn) GsPbaClient { return &gsPbaClient{cc} } func (c *gsPbaClient) PublishUplink(ctx context.Context, in *GatewayUplinkMessage, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.GsPba/PublishUplink", in, out, opts...) if err != nil { return nil, err } return out, nil } // GsPbaServer is the server API for GsPba service. type GsPbaServer interface { PublishUplink(context.Context, *GatewayUplinkMessage) (*types.Empty, error) } // UnimplementedGsPbaServer can be embedded to have forward compatible implementations. type UnimplementedGsPbaServer struct { } func (*UnimplementedGsPbaServer) PublishUplink(ctx context.Context, req *GatewayUplinkMessage) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method PublishUplink not implemented") } func RegisterGsPbaServer(s *grpc.Server, srv GsPbaServer) { s.RegisterService(&_GsPba_serviceDesc, srv) } func _GsPba_PublishUplink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GatewayUplinkMessage) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(GsPbaServer).PublishUplink(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.GsPba/PublishUplink", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GsPbaServer).PublishUplink(ctx, req.(*GatewayUplinkMessage)) } return interceptor(ctx, in, info, handler) } var _GsPba_serviceDesc = grpc.ServiceDesc{ ServiceName: "ttn.lorawan.v3.GsPba", HandlerType: (*GsPbaServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "PublishUplink", Handler: _GsPba_PublishUplink_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "lorawan-stack/api/packetbrokeragent.proto", } // NsPbaClient is the client API for NsPba service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type NsPbaClient interface { // PublishDownlink instructs the Packet Broker Agent to publish a downlink // message to Packet Broker Router. PublishDownlink(ctx context.Context, in *DownlinkMessage, opts ...grpc.CallOption) (*types.Empty, error) } type nsPbaClient struct { cc *grpc.ClientConn } func NewNsPbaClient(cc *grpc.ClientConn) NsPbaClient { return &nsPbaClient{cc} } func (c *nsPbaClient) PublishDownlink(ctx context.Context, in *DownlinkMessage, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.NsPba/PublishDownlink", in, out, opts...) if err != nil { return nil, err } return out, nil } // NsPbaServer is the server API for NsPba service. type NsPbaServer interface { // PublishDownlink instructs the Packet Broker Agent to publish a downlink // message to Packet Broker Router. PublishDownlink(context.Context, *DownlinkMessage) (*types.Empty, error) } // UnimplementedNsPbaServer can be embedded to have forward compatible implementations. type UnimplementedNsPbaServer struct { } func (*UnimplementedNsPbaServer) PublishDownlink(ctx context.Context, req *DownlinkMessage) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method PublishDownlink not implemented") } func RegisterNsPbaServer(s *grpc.Server, srv NsPbaServer) { s.RegisterService(&_NsPba_serviceDesc, srv) } func _NsPba_PublishDownlink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DownlinkMessage) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(NsPbaServer).PublishDownlink(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.NsPba/PublishDownlink", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NsPbaServer).PublishDownlink(ctx, req.(*DownlinkMessage)) } return interceptor(ctx, in, info, handler) } var _NsPba_serviceDesc = grpc.ServiceDesc{ ServiceName: "ttn.lorawan.v3.NsPba", HandlerType: (*NsPbaServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "PublishDownlink", Handler: _NsPba_PublishDownlink_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "lorawan-stack/api/packetbrokeragent.proto", } // PbaClient is the client API for Pba service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type PbaClient interface { // Get information about the Packet Broker registration. // Viewing Packet Packet information requires administrative access. GetInfo(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*PacketBrokerInfo, error) // Register with Packet Broker. If no registration exists, it will be created. Any existing registration will be updated. // All registration settings are taken from Packet Broker Agent configuration and caller context. // Packet Broker registration requires administrative access. Register(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*PacketBrokerNetwork, error) // Deregister from Packet Broker. // Packet Broker deregistration requires administrative access. Deregister(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*types.Empty, error) // Get the default routing policy. // Getting routing policies requires administrative access. GetHomeNetworkDefaultRoutingPolicy(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*PacketBrokerDefaultRoutingPolicy, error) // Set the default routing policy. // Setting routing policies requires administrative access. SetHomeNetworkDefaultRoutingPolicy(ctx context.Context, in *SetPacketBrokerDefaultRoutingPolicyRequest, opts ...grpc.CallOption) (*types.Empty, error) // Deletes the default routing policy. // Deleting routing policies requires administrative access. DeleteHomeNetworkDefaultRoutingPolicy(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*types.Empty, error) // List the routing policies that Packet Broker Agent as Forwarder configured with Home Networks. // Listing routing policies requires administrative access. ListHomeNetworkRoutingPolicies(ctx context.Context, in *ListHomeNetworkRoutingPoliciesRequest, opts ...grpc.CallOption) (*PacketBrokerRoutingPolicies, error) // Get the routing policy for the given Home Network. // Getting routing policies requires administrative access. GetHomeNetworkRoutingPolicy(ctx context.Context, in *PacketBrokerNetworkIdentifier, opts ...grpc.CallOption) (*PacketBrokerRoutingPolicy, error) // Set the routing policy for the given Home Network. // Setting routing policies requires administrative access. SetHomeNetworkRoutingPolicy(ctx context.Context, in *SetPacketBrokerRoutingPolicyRequest, opts ...grpc.CallOption) (*types.Empty, error) // Delete the routing policy for the given Home Network. // Deleting routing policies requires administrative access. DeleteHomeNetworkRoutingPolicy(ctx context.Context, in *PacketBrokerNetworkIdentifier, opts ...grpc.CallOption) (*types.Empty, error) // List all listed networks. // Listing networks requires administrative access. ListNetworks(ctx context.Context, in *ListPacketBrokerNetworksRequest, opts ...grpc.CallOption) (*PacketBrokerNetworks, error) // List the listed home networks for which routing policies can be configured. // Listing home networks requires administrative access. ListHomeNetworks(ctx context.Context, in *ListPacketBrokerHomeNetworksRequest, opts ...grpc.CallOption) (*PacketBrokerNetworks, error) // List the routing policies that Forwarders configured with Packet Broker Agent as Home Network. // Listing routing policies requires administrative access. ListForwarderRoutingPolicies(ctx context.Context, in *ListForwarderRoutingPoliciesRequest, opts ...grpc.CallOption) (*PacketBrokerRoutingPolicies, error) } type pbaClient struct { cc *grpc.ClientConn } func NewPbaClient(cc *grpc.ClientConn) PbaClient { return &pbaClient{cc} } func (c *pbaClient) GetInfo(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*PacketBrokerInfo, error) { out := new(PacketBrokerInfo) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/GetInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) Register(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*PacketBrokerNetwork, error) { out := new(PacketBrokerNetwork) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/Register", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) Deregister(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/Deregister", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) GetHomeNetworkDefaultRoutingPolicy(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*PacketBrokerDefaultRoutingPolicy, error) { out := new(PacketBrokerDefaultRoutingPolicy) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/GetHomeNetworkDefaultRoutingPolicy", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) SetHomeNetworkDefaultRoutingPolicy(ctx context.Context, in *SetPacketBrokerDefaultRoutingPolicyRequest, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/SetHomeNetworkDefaultRoutingPolicy", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) DeleteHomeNetworkDefaultRoutingPolicy(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/DeleteHomeNetworkDefaultRoutingPolicy", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) ListHomeNetworkRoutingPolicies(ctx context.Context, in *ListHomeNetworkRoutingPoliciesRequest, opts ...grpc.CallOption) (*PacketBrokerRoutingPolicies, error) { out := new(PacketBrokerRoutingPolicies) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/ListHomeNetworkRoutingPolicies", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) GetHomeNetworkRoutingPolicy(ctx context.Context, in *PacketBrokerNetworkIdentifier, opts ...grpc.CallOption) (*PacketBrokerRoutingPolicy, error) { out := new(PacketBrokerRoutingPolicy) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/GetHomeNetworkRoutingPolicy", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) SetHomeNetworkRoutingPolicy(ctx context.Context, in *SetPacketBrokerRoutingPolicyRequest, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/SetHomeNetworkRoutingPolicy", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) DeleteHomeNetworkRoutingPolicy(ctx context.Context, in *PacketBrokerNetworkIdentifier, opts ...grpc.CallOption) (*types.Empty, error) { out := new(types.Empty) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/DeleteHomeNetworkRoutingPolicy", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) ListNetworks(ctx context.Context, in *ListPacketBrokerNetworksRequest, opts ...grpc.CallOption) (*PacketBrokerNetworks, error) { out := new(PacketBrokerNetworks) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/ListNetworks", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) ListHomeNetworks(ctx context.Context, in *ListPacketBrokerHomeNetworksRequest, opts ...grpc.CallOption) (*PacketBrokerNetworks, error) { out := new(PacketBrokerNetworks) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/ListHomeNetworks", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *pbaClient) ListForwarderRoutingPolicies(ctx context.Context, in *ListForwarderRoutingPoliciesRequest, opts ...grpc.CallOption) (*PacketBrokerRoutingPolicies, error) { out := new(PacketBrokerRoutingPolicies) err := c.cc.Invoke(ctx, "/ttn.lorawan.v3.Pba/ListForwarderRoutingPolicies", in, out, opts...) if err != nil { return nil, err } return out, nil } // PbaServer is the server API for Pba service. type PbaServer interface { // Get information about the Packet Broker registration. // Viewing Packet Packet information requires administrative access. GetInfo(context.Context, *types.Empty) (*PacketBrokerInfo, error) // Register with Packet Broker. If no registration exists, it will be created. Any existing registration will be updated. // All registration settings are taken from Packet Broker Agent configuration and caller context. // Packet Broker registration requires administrative access. Register(context.Context, *types.Empty) (*PacketBrokerNetwork, error) // Deregister from Packet Broker. // Packet Broker deregistration requires administrative access. Deregister(context.Context, *types.Empty) (*types.Empty, error) // Get the default routing policy. // Getting routing policies requires administrative access. GetHomeNetworkDefaultRoutingPolicy(context.Context, *types.Empty) (*PacketBrokerDefaultRoutingPolicy, error) // Set the default routing policy. // Setting routing policies requires administrative access. SetHomeNetworkDefaultRoutingPolicy(context.Context, *SetPacketBrokerDefaultRoutingPolicyRequest) (*types.Empty, error) // Deletes the default routing policy. // Deleting routing policies requires administrative access. DeleteHomeNetworkDefaultRoutingPolicy(context.Context, *types.Empty) (*types.Empty, error) // List the routing policies that Packet Broker Agent as Forwarder configured with Home Networks. // Listing routing policies requires administrative access. ListHomeNetworkRoutingPolicies(context.Context, *ListHomeNetworkRoutingPoliciesRequest) (*PacketBrokerRoutingPolicies, error) // Get the routing policy for the given Home Network. // Getting routing policies requires administrative access. GetHomeNetworkRoutingPolicy(context.Context, *PacketBrokerNetworkIdentifier) (*PacketBrokerRoutingPolicy, error) // Set the routing policy for the given Home Network. // Setting routing policies requires administrative access. SetHomeNetworkRoutingPolicy(context.Context, *SetPacketBrokerRoutingPolicyRequest) (*types.Empty, error) // Delete the routing policy for the given Home Network. // Deleting routing policies requires administrative access. DeleteHomeNetworkRoutingPolicy(context.Context, *PacketBrokerNetworkIdentifier) (*types.Empty, error) // List all listed networks. // Listing networks requires administrative access. ListNetworks(context.Context, *ListPacketBrokerNetworksRequest) (*PacketBrokerNetworks, error) // List the listed home networks for which routing policies can be configured. // Listing home networks requires administrative access. ListHomeNetworks(context.Context, *ListPacketBrokerHomeNetworksRequest) (*PacketBrokerNetworks, error) // List the routing policies that Forwarders configured with Packet Broker Agent as Home Network. // Listing routing policies requires administrative access. ListForwarderRoutingPolicies(context.Context, *ListForwarderRoutingPoliciesRequest) (*PacketBrokerRoutingPolicies, error) } // UnimplementedPbaServer can be embedded to have forward compatible implementations. type UnimplementedPbaServer struct { } func (*UnimplementedPbaServer) GetInfo(ctx context.Context, req *types.Empty) (*PacketBrokerInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") } func (*UnimplementedPbaServer) Register(ctx context.Context, req *types.Empty) (*PacketBrokerNetwork, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } func (*UnimplementedPbaServer) Deregister(ctx context.Context, req *types.Empty) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Deregister not implemented") } func (*UnimplementedPbaServer) GetHomeNetworkDefaultRoutingPolicy(ctx context.Context, req *types.Empty) (*PacketBrokerDefaultRoutingPolicy, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHomeNetworkDefaultRoutingPolicy not implemented") } func (*UnimplementedPbaServer) SetHomeNetworkDefaultRoutingPolicy(ctx context.Context, req *SetPacketBrokerDefaultRoutingPolicyRequest) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SetHomeNetworkDefaultRoutingPolicy not implemented") } func (*UnimplementedPbaServer) DeleteHomeNetworkDefaultRoutingPolicy(ctx context.Context, req *types.Empty) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteHomeNetworkDefaultRoutingPolicy not implemented") } func (*UnimplementedPbaServer) ListHomeNetworkRoutingPolicies(ctx context.Context, req *ListHomeNetworkRoutingPoliciesRequest) (*PacketBrokerRoutingPolicies, error) { return nil, status.Errorf(codes.Unimplemented, "method ListHomeNetworkRoutingPolicies not implemented") } func (*UnimplementedPbaServer) GetHomeNetworkRoutingPolicy(ctx context.Context, req *PacketBrokerNetworkIdentifier) (*PacketBrokerRoutingPolicy, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHomeNetworkRoutingPolicy not implemented") } func (*UnimplementedPbaServer) SetHomeNetworkRoutingPolicy(ctx context.Context, req *SetPacketBrokerRoutingPolicyRequest) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SetHomeNetworkRoutingPolicy not implemented") } func (*UnimplementedPbaServer) DeleteHomeNetworkRoutingPolicy(ctx context.Context, req *PacketBrokerNetworkIdentifier) (*types.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteHomeNetworkRoutingPolicy not implemented") } func (*UnimplementedPbaServer) ListNetworks(ctx context.Context, req *ListPacketBrokerNetworksRequest) (*PacketBrokerNetworks, error) { return nil, status.Errorf(codes.Unimplemented, "method ListNetworks not implemented") } func (*UnimplementedPbaServer) ListHomeNetworks(ctx context.Context, req *ListPacketBrokerHomeNetworksRequest) (*PacketBrokerNetworks, error) { return nil, status.Errorf(codes.Unimplemented, "method ListHomeNetworks not implemented") } func (*UnimplementedPbaServer) ListForwarderRoutingPolicies(ctx context.Context, req *ListForwarderRoutingPoliciesRequest) (*PacketBrokerRoutingPolicies, error) { return nil, status.Errorf(codes.Unimplemented, "method ListForwarderRoutingPolicies not implemented") } func RegisterPbaServer(s *grpc.Server, srv PbaServer) { s.RegisterService(&_Pba_serviceDesc, srv) } func _Pba_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(types.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).GetInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/GetInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).GetInfo(ctx, req.(*types.Empty)) } return interceptor(ctx, in, info, handler) } func _Pba_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(types.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).Register(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/Register", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).Register(ctx, req.(*types.Empty)) } return interceptor(ctx, in, info, handler) } func _Pba_Deregister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(types.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).Deregister(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/Deregister", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).Deregister(ctx, req.(*types.Empty)) } return interceptor(ctx, in, info, handler) } func _Pba_GetHomeNetworkDefaultRoutingPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(types.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).GetHomeNetworkDefaultRoutingPolicy(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/GetHomeNetworkDefaultRoutingPolicy", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).GetHomeNetworkDefaultRoutingPolicy(ctx, req.(*types.Empty)) } return interceptor(ctx, in, info, handler) } func _Pba_SetHomeNetworkDefaultRoutingPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetPacketBrokerDefaultRoutingPolicyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).SetHomeNetworkDefaultRoutingPolicy(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/SetHomeNetworkDefaultRoutingPolicy", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).SetHomeNetworkDefaultRoutingPolicy(ctx, req.(*SetPacketBrokerDefaultRoutingPolicyRequest)) } return interceptor(ctx, in, info, handler) } func _Pba_DeleteHomeNetworkDefaultRoutingPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(types.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).DeleteHomeNetworkDefaultRoutingPolicy(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/DeleteHomeNetworkDefaultRoutingPolicy", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).DeleteHomeNetworkDefaultRoutingPolicy(ctx, req.(*types.Empty)) } return interceptor(ctx, in, info, handler) } func _Pba_ListHomeNetworkRoutingPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListHomeNetworkRoutingPoliciesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).ListHomeNetworkRoutingPolicies(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/ListHomeNetworkRoutingPolicies", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).ListHomeNetworkRoutingPolicies(ctx, req.(*ListHomeNetworkRoutingPoliciesRequest)) } return interceptor(ctx, in, info, handler) } func _Pba_GetHomeNetworkRoutingPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PacketBrokerNetworkIdentifier) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).GetHomeNetworkRoutingPolicy(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/GetHomeNetworkRoutingPolicy", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).GetHomeNetworkRoutingPolicy(ctx, req.(*PacketBrokerNetworkIdentifier)) } return interceptor(ctx, in, info, handler) } func _Pba_SetHomeNetworkRoutingPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetPacketBrokerRoutingPolicyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).SetHomeNetworkRoutingPolicy(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/SetHomeNetworkRoutingPolicy", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).SetHomeNetworkRoutingPolicy(ctx, req.(*SetPacketBrokerRoutingPolicyRequest)) } return interceptor(ctx, in, info, handler) } func _Pba_DeleteHomeNetworkRoutingPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PacketBrokerNetworkIdentifier) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).DeleteHomeNetworkRoutingPolicy(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/DeleteHomeNetworkRoutingPolicy", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).DeleteHomeNetworkRoutingPolicy(ctx, req.(*PacketBrokerNetworkIdentifier)) } return interceptor(ctx, in, info, handler) } func _Pba_ListNetworks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListPacketBrokerNetworksRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).ListNetworks(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/ListNetworks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).ListNetworks(ctx, req.(*ListPacketBrokerNetworksRequest)) } return interceptor(ctx, in, info, handler) } func _Pba_ListHomeNetworks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListPacketBrokerHomeNetworksRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).ListHomeNetworks(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/ListHomeNetworks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).ListHomeNetworks(ctx, req.(*ListPacketBrokerHomeNetworksRequest)) } return interceptor(ctx, in, info, handler) } func _Pba_ListForwarderRoutingPolicies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListForwarderRoutingPoliciesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(PbaServer).ListForwarderRoutingPolicies(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/ttn.lorawan.v3.Pba/ListForwarderRoutingPolicies", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PbaServer).ListForwarderRoutingPolicies(ctx, req.(*ListForwarderRoutingPoliciesRequest)) } return interceptor(ctx, in, info, handler) } var _Pba_serviceDesc = grpc.ServiceDesc{ ServiceName: "ttn.lorawan.v3.Pba", HandlerType: (*PbaServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetInfo", Handler: _Pba_GetInfo_Handler, }, { MethodName: "Register", Handler: _Pba_Register_Handler, }, { MethodName: "Deregister", Handler: _Pba_Deregister_Handler, }, { MethodName: "GetHomeNetworkDefaultRoutingPolicy", Handler: _Pba_GetHomeNetworkDefaultRoutingPolicy_Handler, }, { MethodName: "SetHomeNetworkDefaultRoutingPolicy", Handler: _Pba_SetHomeNetworkDefaultRoutingPolicy_Handler, }, { MethodName: "DeleteHomeNetworkDefaultRoutingPolicy", Handler: _Pba_DeleteHomeNetworkDefaultRoutingPolicy_Handler, }, { MethodName: "ListHomeNetworkRoutingPolicies", Handler: _Pba_ListHomeNetworkRoutingPolicies_Handler, }, { MethodName: "GetHomeNetworkRoutingPolicy", Handler: _Pba_GetHomeNetworkRoutingPolicy_Handler, }, { MethodName: "SetHomeNetworkRoutingPolicy", Handler: _Pba_SetHomeNetworkRoutingPolicy_Handler, }, { MethodName: "DeleteHomeNetworkRoutingPolicy", Handler: _Pba_DeleteHomeNetworkRoutingPolicy_Handler, }, { MethodName: "ListNetworks", Handler: _Pba_ListNetworks_Handler, }, { MethodName: "ListHomeNetworks", Handler: _Pba_ListHomeNetworks_Handler, }, { MethodName: "ListForwarderRoutingPolicies", Handler: _Pba_ListForwarderRoutingPolicies_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "lorawan-stack/api/packetbrokeragent.proto", } func (m *PacketBrokerNetworkIdentifier) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerNetworkIdentifier) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerNetworkIdentifier) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.TenantId) > 0 { i -= len(m.TenantId) copy(dAtA[i:], m.TenantId) i = encodeVarintPacketbrokeragent(dAtA, i, uint64(len(m.TenantId))) i-- dAtA[i] = 0x12 } if m.NetID != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.NetID)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *PacketBrokerDevAddrBlock) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerDevAddrBlock) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerDevAddrBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.HomeNetworkClusterID) > 0 { i -= len(m.HomeNetworkClusterID) copy(dAtA[i:], m.HomeNetworkClusterID) i = encodeVarintPacketbrokeragent(dAtA, i, uint64(len(m.HomeNetworkClusterID))) i-- dAtA[i] = 0x12 } if m.DevAddrPrefix != nil { { size, err := m.DevAddrPrefix.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PacketBrokerNetwork) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerNetwork) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerNetwork) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Listed { i-- if m.Listed { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x28 } if len(m.ContactInfo) > 0 { for iNdEx := len(m.ContactInfo) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.ContactInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } } if len(m.DevAddrBlocks) > 0 { for iNdEx := len(m.DevAddrBlocks) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.DevAddrBlocks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintPacketbrokeragent(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Id != nil { { size, err := m.Id.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PacketBrokerNetworks) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerNetworks) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerNetworks) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Networks) > 0 { for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *PacketBrokerInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.HomeNetworkEnabled { i-- if m.HomeNetworkEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if m.ForwarderEnabled { i-- if m.ForwarderEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if m.Registration != nil { { size, err := m.Registration.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PacketBrokerRoutingPolicyUplink) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerRoutingPolicyUplink) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerRoutingPolicyUplink) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Localization { i-- if m.Localization { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x28 } if m.SignalQuality { i-- if m.SignalQuality { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x20 } if m.ApplicationData { i-- if m.ApplicationData { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if m.MacData { i-- if m.MacData { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if m.JoinRequest { i-- if m.JoinRequest { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *PacketBrokerRoutingPolicyDownlink) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerRoutingPolicyDownlink) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerRoutingPolicyDownlink) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.ApplicationData { i-- if m.ApplicationData { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if m.MacData { i-- if m.MacData { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if m.JoinAccept { i-- if m.JoinAccept { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *PacketBrokerDefaultRoutingPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerDefaultRoutingPolicy) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerDefaultRoutingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Downlink != nil { { size, err := m.Downlink.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.Uplink != nil { { size, err := m.Uplink.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.UpdatedAt != nil { { size, err := m.UpdatedAt.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PacketBrokerRoutingPolicy) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerRoutingPolicy) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerRoutingPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Downlink != nil { { size, err := m.Downlink.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } if m.Uplink != nil { { size, err := m.Uplink.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if m.UpdatedAt != nil { { size, err := m.UpdatedAt.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.HomeNetworkId != nil { { size, err := m.HomeNetworkId.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.ForwarderId != nil { { size, err := m.ForwarderId.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Downlink != nil { { size, err := m.Downlink.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Uplink != nil { { size, err := m.Uplink.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListHomeNetworkRoutingPoliciesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListHomeNetworkRoutingPoliciesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListHomeNetworkRoutingPoliciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Page != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.Page)) i-- dAtA[i] = 0x10 } if m.Limit != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.Limit)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *PacketBrokerRoutingPolicies) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PacketBrokerRoutingPolicies) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PacketBrokerRoutingPolicies) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Policies) > 0 { for iNdEx := len(m.Policies) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Policies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *SetPacketBrokerRoutingPolicyRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *SetPacketBrokerRoutingPolicyRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *SetPacketBrokerRoutingPolicyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Downlink != nil { { size, err := m.Downlink.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.Uplink != nil { { size, err := m.Uplink.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.HomeNetworkId != nil { { size, err := m.HomeNetworkId.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListPacketBrokerNetworksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPacketBrokerNetworksRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListPacketBrokerNetworksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.NameContains) > 0 { i -= len(m.NameContains) copy(dAtA[i:], m.NameContains) i = encodeVarintPacketbrokeragent(dAtA, i, uint64(len(m.NameContains))) i-- dAtA[i] = 0x2a } if len(m.TenantIdContains) > 0 { i -= len(m.TenantIdContains) copy(dAtA[i:], m.TenantIdContains) i = encodeVarintPacketbrokeragent(dAtA, i, uint64(len(m.TenantIdContains))) i-- dAtA[i] = 0x22 } if m.WithRoutingPolicy { i-- if m.WithRoutingPolicy { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if m.Page != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.Page)) i-- dAtA[i] = 0x10 } if m.Limit != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.Limit)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *ListPacketBrokerHomeNetworksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPacketBrokerHomeNetworksRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListPacketBrokerHomeNetworksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.NameContains) > 0 { i -= len(m.NameContains) copy(dAtA[i:], m.NameContains) i = encodeVarintPacketbrokeragent(dAtA, i, uint64(len(m.NameContains))) i-- dAtA[i] = 0x22 } if len(m.TenantIdContains) > 0 { i -= len(m.TenantIdContains) copy(dAtA[i:], m.TenantIdContains) i = encodeVarintPacketbrokeragent(dAtA, i, uint64(len(m.TenantIdContains))) i-- dAtA[i] = 0x1a } if m.Page != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.Page)) i-- dAtA[i] = 0x10 } if m.Limit != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.Limit)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *ListForwarderRoutingPoliciesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListForwarderRoutingPoliciesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListForwarderRoutingPoliciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Page != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.Page)) i-- dAtA[i] = 0x18 } if m.Limit != 0 { i = encodeVarintPacketbrokeragent(dAtA, i, uint64(m.Limit)) i-- dAtA[i] = 0x10 } if m.HomeNetworkId != nil { { size, err := m.HomeNetworkId.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintPacketbrokeragent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintPacketbrokeragent(dAtA []byte, offset int, v uint64) int { offset -= sovPacketbrokeragent(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func NewPopulatedPacketBrokerNetworkIdentifier(r randyPacketbrokeragent, easy bool) *PacketBrokerNetworkIdentifier { this := &PacketBrokerNetworkIdentifier{} this.NetID = r.Uint32() this.TenantId = randStringPacketbrokeragent(r) if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerDevAddrBlock(r randyPacketbrokeragent, easy bool) *PacketBrokerDevAddrBlock { this := &PacketBrokerDevAddrBlock{} if r.Intn(5) != 0 { this.DevAddrPrefix = NewPopulatedDevAddrPrefix(r, easy) } this.HomeNetworkClusterID = randStringPacketbrokeragent(r) if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerNetwork(r randyPacketbrokeragent, easy bool) *PacketBrokerNetwork { this := &PacketBrokerNetwork{} if r.Intn(5) != 0 { this.Id = NewPopulatedPacketBrokerNetworkIdentifier(r, easy) } this.Name = randStringPacketbrokeragent(r) if r.Intn(5) != 0 { v1 := r.Intn(5) this.DevAddrBlocks = make([]*PacketBrokerDevAddrBlock, v1) for i := 0; i < v1; i++ { this.DevAddrBlocks[i] = NewPopulatedPacketBrokerDevAddrBlock(r, easy) } } if r.Intn(5) != 0 { v2 := r.Intn(5) this.ContactInfo = make([]*ContactInfo, v2) for i := 0; i < v2; i++ { this.ContactInfo[i] = NewPopulatedContactInfo(r, easy) } } this.Listed = bool(r.Intn(2) == 0) if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerNetworks(r randyPacketbrokeragent, easy bool) *PacketBrokerNetworks { this := &PacketBrokerNetworks{} if r.Intn(5) != 0 { v3 := r.Intn(5) this.Networks = make([]*PacketBrokerNetwork, v3) for i := 0; i < v3; i++ { this.Networks[i] = NewPopulatedPacketBrokerNetwork(r, easy) } } if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerInfo(r randyPacketbrokeragent, easy bool) *PacketBrokerInfo { this := &PacketBrokerInfo{} if r.Intn(5) != 0 { this.Registration = NewPopulatedPacketBrokerNetwork(r, easy) } this.ForwarderEnabled = bool(r.Intn(2) == 0) this.HomeNetworkEnabled = bool(r.Intn(2) == 0) if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerRoutingPolicyUplink(r randyPacketbrokeragent, easy bool) *PacketBrokerRoutingPolicyUplink { this := &PacketBrokerRoutingPolicyUplink{} this.JoinRequest = bool(r.Intn(2) == 0) this.MacData = bool(r.Intn(2) == 0) this.ApplicationData = bool(r.Intn(2) == 0) this.SignalQuality = bool(r.Intn(2) == 0) this.Localization = bool(r.Intn(2) == 0) if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerRoutingPolicyDownlink(r randyPacketbrokeragent, easy bool) *PacketBrokerRoutingPolicyDownlink { this := &PacketBrokerRoutingPolicyDownlink{} this.JoinAccept = bool(r.Intn(2) == 0) this.MacData = bool(r.Intn(2) == 0) this.ApplicationData = bool(r.Intn(2) == 0) if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerDefaultRoutingPolicy(r randyPacketbrokeragent, easy bool) *PacketBrokerDefaultRoutingPolicy { this := &PacketBrokerDefaultRoutingPolicy{} if r.Intn(5) != 0 { this.UpdatedAt = types.NewPopulatedTimestamp(r, easy) } if r.Intn(5) != 0 { this.Uplink = NewPopulatedPacketBrokerRoutingPolicyUplink(r, easy) } if r.Intn(5) != 0 { this.Downlink = NewPopulatedPacketBrokerRoutingPolicyDownlink(r, easy) } if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerRoutingPolicy(r randyPacketbrokeragent, easy bool) *PacketBrokerRoutingPolicy { this := &PacketBrokerRoutingPolicy{} if r.Intn(5) != 0 { this.ForwarderId = NewPopulatedPacketBrokerNetworkIdentifier(r, easy) } if r.Intn(5) != 0 { this.HomeNetworkId = NewPopulatedPacketBrokerNetworkIdentifier(r, easy) } if r.Intn(5) != 0 { this.UpdatedAt = types.NewPopulatedTimestamp(r, easy) } if r.Intn(5) != 0 { this.Uplink = NewPopulatedPacketBrokerRoutingPolicyUplink(r, easy) } if r.Intn(5) != 0 { this.Downlink = NewPopulatedPacketBrokerRoutingPolicyDownlink(r, easy) } if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedSetPacketBrokerDefaultRoutingPolicyRequest(r randyPacketbrokeragent, easy bool) *SetPacketBrokerDefaultRoutingPolicyRequest { this := &SetPacketBrokerDefaultRoutingPolicyRequest{} if r.Intn(5) != 0 { this.Uplink = NewPopulatedPacketBrokerRoutingPolicyUplink(r, easy) } if r.Intn(5) != 0 { this.Downlink = NewPopulatedPacketBrokerRoutingPolicyDownlink(r, easy) } if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedListHomeNetworkRoutingPoliciesRequest(r randyPacketbrokeragent, easy bool) *ListHomeNetworkRoutingPoliciesRequest { this := &ListHomeNetworkRoutingPoliciesRequest{} this.Limit = r.Uint32() this.Page = r.Uint32() if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedPacketBrokerRoutingPolicies(r randyPacketbrokeragent, easy bool) *PacketBrokerRoutingPolicies { this := &PacketBrokerRoutingPolicies{} if r.Intn(5) != 0 { v4 := r.Intn(5) this.Policies = make([]*PacketBrokerRoutingPolicy, v4) for i := 0; i < v4; i++ { this.Policies[i] = NewPopulatedPacketBrokerRoutingPolicy(r, easy) } } if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedSetPacketBrokerRoutingPolicyRequest(r randyPacketbrokeragent, easy bool) *SetPacketBrokerRoutingPolicyRequest { this := &SetPacketBrokerRoutingPolicyRequest{} if r.Intn(5) != 0 { this.HomeNetworkId = NewPopulatedPacketBrokerNetworkIdentifier(r, easy) } if r.Intn(5) != 0 { this.Uplink = NewPopulatedPacketBrokerRoutingPolicyUplink(r, easy) } if r.Intn(5) != 0 { this.Downlink = NewPopulatedPacketBrokerRoutingPolicyDownlink(r, easy) } if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedListPacketBrokerNetworksRequest(r randyPacketbrokeragent, easy bool) *ListPacketBrokerNetworksRequest { this := &ListPacketBrokerNetworksRequest{} this.Limit = r.Uint32() this.Page = r.Uint32() this.WithRoutingPolicy = bool(r.Intn(2) == 0) this.TenantIdContains = randStringPacketbrokeragent(r) this.NameContains = randStringPacketbrokeragent(r) if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedListPacketBrokerHomeNetworksRequest(r randyPacketbrokeragent, easy bool) *ListPacketBrokerHomeNetworksRequest { this := &ListPacketBrokerHomeNetworksRequest{} this.Limit = r.Uint32() this.Page = r.Uint32() this.TenantIdContains = randStringPacketbrokeragent(r) this.NameContains = randStringPacketbrokeragent(r) if !easy && r.Intn(10) != 0 { } return this } func NewPopulatedListForwarderRoutingPoliciesRequest(r randyPacketbrokeragent, easy bool) *ListForwarderRoutingPoliciesRequest { this := &ListForwarderRoutingPoliciesRequest{} if r.Intn(5) != 0 { this.HomeNetworkId = NewPopulatedPacketBrokerNetworkIdentifier(r, easy) } this.Limit = r.Uint32() this.Page = r.Uint32() if !easy && r.Intn(10) != 0 { } return this } type randyPacketbrokeragent interface { Float32() float32 Float64() float64 Int63() int64 Int31() int32 Uint32() uint32 Intn(n int) int } func randUTF8RunePacketbrokeragent(r randyPacketbrokeragent) rune { ru := r.Intn(62) if ru < 10 { return rune(ru + 48) } else if ru < 36 { return rune(ru + 55) } return rune(ru + 61) } func randStringPacketbrokeragent(r randyPacketbrokeragent) string { v5 := r.Intn(100) tmps := make([]rune, v5) for i := 0; i < v5; i++ { tmps[i] = randUTF8RunePacketbrokeragent(r) } return string(tmps) } func randUnrecognizedPacketbrokeragent(r randyPacketbrokeragent, maxFieldNumber int) (dAtA []byte) { l := r.Intn(5) for i := 0; i < l; i++ { wire := r.Intn(4) if wire == 3 { wire = 5 } fieldNumber := maxFieldNumber + r.Intn(100) dAtA = randFieldPacketbrokeragent(dAtA, r, fieldNumber, wire) } return dAtA } func randFieldPacketbrokeragent(dAtA []byte, r randyPacketbrokeragent, fieldNumber int, wire int) []byte { key := uint32(fieldNumber)<<3 | uint32(wire) switch wire { case 0: dAtA = encodeVarintPopulatePacketbrokeragent(dAtA, uint64(key)) v6 := r.Int63() if r.Intn(2) == 0 { v6 *= -1 } dAtA = encodeVarintPopulatePacketbrokeragent(dAtA, uint64(v6)) case 1: dAtA = encodeVarintPopulatePacketbrokeragent(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) case 2: dAtA = encodeVarintPopulatePacketbrokeragent(dAtA, uint64(key)) ll := r.Intn(100) dAtA = encodeVarintPopulatePacketbrokeragent(dAtA, uint64(ll)) for j := 0; j < ll; j++ { dAtA = append(dAtA, byte(r.Intn(256))) } default: dAtA = encodeVarintPopulatePacketbrokeragent(dAtA, uint64(key)) dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) } return dAtA } func encodeVarintPopulatePacketbrokeragent(dAtA []byte, v uint64) []byte { for v >= 1<<7 { dAtA = append(dAtA, uint8(v&0x7f|0x80)) v >>= 7 } dAtA = append(dAtA, uint8(v)) return dAtA } func (m *PacketBrokerNetworkIdentifier) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.NetID != 0 { n += 1 + sovPacketbrokeragent(uint64(m.NetID)) } l = len(m.TenantId) if l > 0 { n += 1 + l + sovPacketbrokeragent(uint64(l)) } return n } func (m *PacketBrokerDevAddrBlock) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.DevAddrPrefix != nil { l = m.DevAddrPrefix.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } l = len(m.HomeNetworkClusterID) if l > 0 { n += 1 + l + sovPacketbrokeragent(uint64(l)) } return n } func (m *PacketBrokerNetwork) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Id != nil { l = m.Id.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } l = len(m.Name) if l > 0 { n += 1 + l + sovPacketbrokeragent(uint64(l)) } if len(m.DevAddrBlocks) > 0 { for _, e := range m.DevAddrBlocks { l = e.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } } if len(m.ContactInfo) > 0 { for _, e := range m.ContactInfo { l = e.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } } if m.Listed { n += 2 } return n } func (m *PacketBrokerNetworks) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Networks) > 0 { for _, e := range m.Networks { l = e.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } } return n } func (m *PacketBrokerInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Registration != nil { l = m.Registration.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.ForwarderEnabled { n += 2 } if m.HomeNetworkEnabled { n += 2 } return n } func (m *PacketBrokerRoutingPolicyUplink) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.JoinRequest { n += 2 } if m.MacData { n += 2 } if m.ApplicationData { n += 2 } if m.SignalQuality { n += 2 } if m.Localization { n += 2 } return n } func (m *PacketBrokerRoutingPolicyDownlink) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.JoinAccept { n += 2 } if m.MacData { n += 2 } if m.ApplicationData { n += 2 } return n } func (m *PacketBrokerDefaultRoutingPolicy) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.UpdatedAt != nil { l = m.UpdatedAt.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.Uplink != nil { l = m.Uplink.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.Downlink != nil { l = m.Downlink.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } return n } func (m *PacketBrokerRoutingPolicy) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ForwarderId != nil { l = m.ForwarderId.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.HomeNetworkId != nil { l = m.HomeNetworkId.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.UpdatedAt != nil { l = m.UpdatedAt.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.Uplink != nil { l = m.Uplink.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.Downlink != nil { l = m.Downlink.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } return n } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Uplink != nil { l = m.Uplink.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.Downlink != nil { l = m.Downlink.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } return n } func (m *ListHomeNetworkRoutingPoliciesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Limit != 0 { n += 1 + sovPacketbrokeragent(uint64(m.Limit)) } if m.Page != 0 { n += 1 + sovPacketbrokeragent(uint64(m.Page)) } return n } func (m *PacketBrokerRoutingPolicies) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Policies) > 0 { for _, e := range m.Policies { l = e.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } } return n } func (m *SetPacketBrokerRoutingPolicyRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.HomeNetworkId != nil { l = m.HomeNetworkId.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.Uplink != nil { l = m.Uplink.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.Downlink != nil { l = m.Downlink.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } return n } func (m *ListPacketBrokerNetworksRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Limit != 0 { n += 1 + sovPacketbrokeragent(uint64(m.Limit)) } if m.Page != 0 { n += 1 + sovPacketbrokeragent(uint64(m.Page)) } if m.WithRoutingPolicy { n += 2 } l = len(m.TenantIdContains) if l > 0 { n += 1 + l + sovPacketbrokeragent(uint64(l)) } l = len(m.NameContains) if l > 0 { n += 1 + l + sovPacketbrokeragent(uint64(l)) } return n } func (m *ListPacketBrokerHomeNetworksRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Limit != 0 { n += 1 + sovPacketbrokeragent(uint64(m.Limit)) } if m.Page != 0 { n += 1 + sovPacketbrokeragent(uint64(m.Page)) } l = len(m.TenantIdContains) if l > 0 { n += 1 + l + sovPacketbrokeragent(uint64(l)) } l = len(m.NameContains) if l > 0 { n += 1 + l + sovPacketbrokeragent(uint64(l)) } return n } func (m *ListForwarderRoutingPoliciesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.HomeNetworkId != nil { l = m.HomeNetworkId.Size() n += 1 + l + sovPacketbrokeragent(uint64(l)) } if m.Limit != 0 { n += 1 + sovPacketbrokeragent(uint64(m.Limit)) } if m.Page != 0 { n += 1 + sovPacketbrokeragent(uint64(m.Page)) } return n } func sovPacketbrokeragent(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozPacketbrokeragent(x uint64) (n int) { return sovPacketbrokeragent((x << 1) ^ uint64((int64(x) >> 63))) } func (this *PacketBrokerNetworkIdentifier) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PacketBrokerNetworkIdentifier{`, `NetID:` + fmt.Sprintf("%v", this.NetID) + `,`, `TenantId:` + fmt.Sprintf("%v", this.TenantId) + `,`, `}`, }, "") return s } func (this *PacketBrokerDevAddrBlock) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PacketBrokerDevAddrBlock{`, `DevAddrPrefix:` + strings.Replace(fmt.Sprintf("%v", this.DevAddrPrefix), "DevAddrPrefix", "DevAddrPrefix", 1) + `,`, `HomeNetworkClusterID:` + fmt.Sprintf("%v", this.HomeNetworkClusterID) + `,`, `}`, }, "") return s } func (this *PacketBrokerNetwork) String() string { if this == nil { return "nil" } repeatedStringForDevAddrBlocks := "[]*PacketBrokerDevAddrBlock{" for _, f := range this.DevAddrBlocks { repeatedStringForDevAddrBlocks += strings.Replace(f.String(), "PacketBrokerDevAddrBlock", "PacketBrokerDevAddrBlock", 1) + "," } repeatedStringForDevAddrBlocks += "}" repeatedStringForContactInfo := "[]*ContactInfo{" for _, f := range this.ContactInfo { repeatedStringForContactInfo += strings.Replace(fmt.Sprintf("%v", f), "ContactInfo", "ContactInfo", 1) + "," } repeatedStringForContactInfo += "}" s := strings.Join([]string{`&PacketBrokerNetwork{`, `Id:` + strings.Replace(this.Id.String(), "PacketBrokerNetworkIdentifier", "PacketBrokerNetworkIdentifier", 1) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `DevAddrBlocks:` + repeatedStringForDevAddrBlocks + `,`, `ContactInfo:` + repeatedStringForContactInfo + `,`, `Listed:` + fmt.Sprintf("%v", this.Listed) + `,`, `}`, }, "") return s } func (this *PacketBrokerNetworks) String() string { if this == nil { return "nil" } repeatedStringForNetworks := "[]*PacketBrokerNetwork{" for _, f := range this.Networks { repeatedStringForNetworks += strings.Replace(f.String(), "PacketBrokerNetwork", "PacketBrokerNetwork", 1) + "," } repeatedStringForNetworks += "}" s := strings.Join([]string{`&PacketBrokerNetworks{`, `Networks:` + repeatedStringForNetworks + `,`, `}`, }, "") return s } func (this *PacketBrokerInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PacketBrokerInfo{`, `Registration:` + strings.Replace(this.Registration.String(), "PacketBrokerNetwork", "PacketBrokerNetwork", 1) + `,`, `ForwarderEnabled:` + fmt.Sprintf("%v", this.ForwarderEnabled) + `,`, `HomeNetworkEnabled:` + fmt.Sprintf("%v", this.HomeNetworkEnabled) + `,`, `}`, }, "") return s } func (this *PacketBrokerRoutingPolicyUplink) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PacketBrokerRoutingPolicyUplink{`, `JoinRequest:` + fmt.Sprintf("%v", this.JoinRequest) + `,`, `MacData:` + fmt.Sprintf("%v", this.MacData) + `,`, `ApplicationData:` + fmt.Sprintf("%v", this.ApplicationData) + `,`, `SignalQuality:` + fmt.Sprintf("%v", this.SignalQuality) + `,`, `Localization:` + fmt.Sprintf("%v", this.Localization) + `,`, `}`, }, "") return s } func (this *PacketBrokerRoutingPolicyDownlink) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PacketBrokerRoutingPolicyDownlink{`, `JoinAccept:` + fmt.Sprintf("%v", this.JoinAccept) + `,`, `MacData:` + fmt.Sprintf("%v", this.MacData) + `,`, `ApplicationData:` + fmt.Sprintf("%v", this.ApplicationData) + `,`, `}`, }, "") return s } func (this *PacketBrokerDefaultRoutingPolicy) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PacketBrokerDefaultRoutingPolicy{`, `UpdatedAt:` + strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1) + `,`, `Uplink:` + strings.Replace(this.Uplink.String(), "PacketBrokerRoutingPolicyUplink", "PacketBrokerRoutingPolicyUplink", 1) + `,`, `Downlink:` + strings.Replace(this.Downlink.String(), "PacketBrokerRoutingPolicyDownlink", "PacketBrokerRoutingPolicyDownlink", 1) + `,`, `}`, }, "") return s } func (this *PacketBrokerRoutingPolicy) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PacketBrokerRoutingPolicy{`, `ForwarderId:` + strings.Replace(this.ForwarderId.String(), "PacketBrokerNetworkIdentifier", "PacketBrokerNetworkIdentifier", 1) + `,`, `HomeNetworkId:` + strings.Replace(this.HomeNetworkId.String(), "PacketBrokerNetworkIdentifier", "PacketBrokerNetworkIdentifier", 1) + `,`, `UpdatedAt:` + strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1) + `,`, `Uplink:` + strings.Replace(this.Uplink.String(), "PacketBrokerRoutingPolicyUplink", "PacketBrokerRoutingPolicyUplink", 1) + `,`, `Downlink:` + strings.Replace(this.Downlink.String(), "PacketBrokerRoutingPolicyDownlink", "PacketBrokerRoutingPolicyDownlink", 1) + `,`, `}`, }, "") return s } func (this *SetPacketBrokerDefaultRoutingPolicyRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&SetPacketBrokerDefaultRoutingPolicyRequest{`, `Uplink:` + strings.Replace(this.Uplink.String(), "PacketBrokerRoutingPolicyUplink", "PacketBrokerRoutingPolicyUplink", 1) + `,`, `Downlink:` + strings.Replace(this.Downlink.String(), "PacketBrokerRoutingPolicyDownlink", "PacketBrokerRoutingPolicyDownlink", 1) + `,`, `}`, }, "") return s } func (this *ListHomeNetworkRoutingPoliciesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListHomeNetworkRoutingPoliciesRequest{`, `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, `Page:` + fmt.Sprintf("%v", this.Page) + `,`, `}`, }, "") return s } func (this *PacketBrokerRoutingPolicies) String() string { if this == nil { return "nil" } repeatedStringForPolicies := "[]*PacketBrokerRoutingPolicy{" for _, f := range this.Policies { repeatedStringForPolicies += strings.Replace(f.String(), "PacketBrokerRoutingPolicy", "PacketBrokerRoutingPolicy", 1) + "," } repeatedStringForPolicies += "}" s := strings.Join([]string{`&PacketBrokerRoutingPolicies{`, `Policies:` + repeatedStringForPolicies + `,`, `}`, }, "") return s } func (this *SetPacketBrokerRoutingPolicyRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&SetPacketBrokerRoutingPolicyRequest{`, `HomeNetworkId:` + strings.Replace(this.HomeNetworkId.String(), "PacketBrokerNetworkIdentifier", "PacketBrokerNetworkIdentifier", 1) + `,`, `Uplink:` + strings.Replace(this.Uplink.String(), "PacketBrokerRoutingPolicyUplink", "PacketBrokerRoutingPolicyUplink", 1) + `,`, `Downlink:` + strings.Replace(this.Downlink.String(), "PacketBrokerRoutingPolicyDownlink", "PacketBrokerRoutingPolicyDownlink", 1) + `,`, `}`, }, "") return s } func (this *ListPacketBrokerNetworksRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListPacketBrokerNetworksRequest{`, `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, `Page:` + fmt.Sprintf("%v", this.Page) + `,`, `WithRoutingPolicy:` + fmt.Sprintf("%v", this.WithRoutingPolicy) + `,`, `TenantIdContains:` + fmt.Sprintf("%v", this.TenantIdContains) + `,`, `NameContains:` + fmt.Sprintf("%v", this.NameContains) + `,`, `}`, }, "") return s } func (this *ListPacketBrokerHomeNetworksRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListPacketBrokerHomeNetworksRequest{`, `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, `Page:` + fmt.Sprintf("%v", this.Page) + `,`, `TenantIdContains:` + fmt.Sprintf("%v", this.TenantIdContains) + `,`, `NameContains:` + fmt.Sprintf("%v", this.NameContains) + `,`, `}`, }, "") return s } func (this *ListForwarderRoutingPoliciesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListForwarderRoutingPoliciesRequest{`, `HomeNetworkId:` + strings.Replace(this.HomeNetworkId.String(), "PacketBrokerNetworkIdentifier", "PacketBrokerNetworkIdentifier", 1) + `,`, `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, `Page:` + fmt.Sprintf("%v", this.Page) + `,`, `}`, }, "") return s } func valueToStringPacketbrokeragent(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *PacketBrokerNetworkIdentifier) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerNetworkIdentifier: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerNetworkIdentifier: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NetID", wireType) } m.NetID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.NetID |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TenantId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.TenantId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerDevAddrBlock) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerDevAddrBlock: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerDevAddrBlock: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DevAddrPrefix", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.DevAddrPrefix == nil { m.DevAddrPrefix = &DevAddrPrefix{} } if err := m.DevAddrPrefix.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HomeNetworkClusterID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.HomeNetworkClusterID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerNetwork) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerNetwork: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerNetwork: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Id == nil { m.Id = &PacketBrokerNetworkIdentifier{} } if err := m.Id.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DevAddrBlocks", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.DevAddrBlocks = append(m.DevAddrBlocks, &PacketBrokerDevAddrBlock{}) if err := m.DevAddrBlocks[len(m.DevAddrBlocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContactInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.ContactInfo = append(m.ContactInfo, &ContactInfo{}) if err := m.ContactInfo[len(m.ContactInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Listed", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Listed = bool(v != 0) default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerNetworks) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerNetworks: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerNetworks: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Networks", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.Networks = append(m.Networks, &PacketBrokerNetwork{}) if err := m.Networks[len(m.Networks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Registration", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Registration == nil { m.Registration = &PacketBrokerNetwork{} } if err := m.Registration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ForwarderEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.ForwarderEnabled = bool(v != 0) case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HomeNetworkEnabled", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.HomeNetworkEnabled = bool(v != 0) default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerRoutingPolicyUplink) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerRoutingPolicyUplink: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerRoutingPolicyUplink: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field JoinRequest", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.JoinRequest = bool(v != 0) case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MacData", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.MacData = bool(v != 0) case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ApplicationData", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.ApplicationData = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SignalQuality", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.SignalQuality = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Localization", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Localization = bool(v != 0) default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerRoutingPolicyDownlink) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerRoutingPolicyDownlink: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerRoutingPolicyDownlink: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field JoinAccept", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.JoinAccept = bool(v != 0) case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MacData", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.MacData = bool(v != 0) case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ApplicationData", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.ApplicationData = bool(v != 0) default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerDefaultRoutingPolicy) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerDefaultRoutingPolicy: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerDefaultRoutingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.UpdatedAt == nil { m.UpdatedAt = &types.Timestamp{} } if err := m.UpdatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uplink", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Uplink == nil { m.Uplink = &PacketBrokerRoutingPolicyUplink{} } if err := m.Uplink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Downlink", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Downlink == nil { m.Downlink = &PacketBrokerRoutingPolicyDownlink{} } if err := m.Downlink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerRoutingPolicy) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerRoutingPolicy: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerRoutingPolicy: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ForwarderId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.ForwarderId == nil { m.ForwarderId = &PacketBrokerNetworkIdentifier{} } if err := m.ForwarderId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HomeNetworkId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.HomeNetworkId == nil { m.HomeNetworkId = &PacketBrokerNetworkIdentifier{} } if err := m.HomeNetworkId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.UpdatedAt == nil { m.UpdatedAt = &types.Timestamp{} } if err := m.UpdatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uplink", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Uplink == nil { m.Uplink = &PacketBrokerRoutingPolicyUplink{} } if err := m.Uplink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Downlink", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Downlink == nil { m.Downlink = &PacketBrokerRoutingPolicyDownlink{} } if err := m.Downlink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *SetPacketBrokerDefaultRoutingPolicyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: SetPacketBrokerDefaultRoutingPolicyRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SetPacketBrokerDefaultRoutingPolicyRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uplink", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Uplink == nil { m.Uplink = &PacketBrokerRoutingPolicyUplink{} } if err := m.Uplink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Downlink", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Downlink == nil { m.Downlink = &PacketBrokerRoutingPolicyDownlink{} } if err := m.Downlink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListHomeNetworkRoutingPoliciesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListHomeNetworkRoutingPoliciesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListHomeNetworkRoutingPoliciesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) } m.Limit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Limit |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType) } m.Page = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Page |= uint32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PacketBrokerRoutingPolicies) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PacketBrokerRoutingPolicies: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PacketBrokerRoutingPolicies: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Policies", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.Policies = append(m.Policies, &PacketBrokerRoutingPolicy{}) if err := m.Policies[len(m.Policies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *SetPacketBrokerRoutingPolicyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: SetPacketBrokerRoutingPolicyRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SetPacketBrokerRoutingPolicyRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HomeNetworkId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.HomeNetworkId == nil { m.HomeNetworkId = &PacketBrokerNetworkIdentifier{} } if err := m.HomeNetworkId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uplink", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Uplink == nil { m.Uplink = &PacketBrokerRoutingPolicyUplink{} } if err := m.Uplink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Downlink", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Downlink == nil { m.Downlink = &PacketBrokerRoutingPolicyDownlink{} } if err := m.Downlink.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPacketBrokerNetworksRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPacketBrokerNetworksRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPacketBrokerNetworksRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) } m.Limit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Limit |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType) } m.Page = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Page |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field WithRoutingPolicy", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.WithRoutingPolicy = bool(v != 0) case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TenantIdContains", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.TenantIdContains = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NameContains", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.NameContains = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPacketBrokerHomeNetworksRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPacketBrokerHomeNetworksRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPacketBrokerHomeNetworksRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) } m.Limit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Limit |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType) } m.Page = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Page |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TenantIdContains", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.TenantIdContains = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NameContains", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } m.NameContains = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListForwarderRoutingPoliciesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListForwarderRoutingPoliciesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListForwarderRoutingPoliciesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HomeNetworkId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthPacketbrokeragent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthPacketbrokeragent } if postIndex > l { return io.ErrUnexpectedEOF } if m.HomeNetworkId == nil { m.HomeNetworkId = &PacketBrokerNetworkIdentifier{} } if err := m.HomeNetworkId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) } m.Limit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Limit |= uint32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType) } m.Page = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Page |= uint32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipPacketbrokeragent(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) < 0 { return ErrInvalidLengthPacketbrokeragent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipPacketbrokeragent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowPacketbrokeragent } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthPacketbrokeragent } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupPacketbrokeragent } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthPacketbrokeragent } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthPacketbrokeragent = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPacketbrokeragent = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPacketbrokeragent = fmt.Errorf("proto: unexpected end of group") )
<reponame>DarlanDelmondes/produtos-favoritos-springboot package com.desafio.labs.springfavs.dto; public class RespostaDTO { private Long favorito; private String mensagem; public RespostaDTO(Long favorito,String mensagem) { super(); this.favorito = favorito; this.mensagem = mensagem; } public RespostaDTO() {} public Long getFavorito() { return favorito; } public void setFavorito(Long favorito) { this.favorito = favorito; } public String getMensagem() { return mensagem; } public void setMensagem(String mensagem) { this.mensagem = mensagem; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( (mensagem == null) ? 0 : mensagem.hashCode()); result = prime * result + ( (favorito == null) ? 0 : favorito.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RespostaDTO other = (RespostaDTO) obj; if (mensagem == null) { if (other.mensagem != null) return false; } else if (!mensagem.equals(other.mensagem)) return false; if (favorito == null) { if (other.favorito != null) return false; } else if (!favorito.equals(other.favorito)) return false; return true; } @Override public String toString() { return "RespostaDTO [favorito=" + favorito + ", mensagem=" + mensagem + "]"; } }
<filename>Java/ProvaFinal/view/TelaCadastroLocacao.java package view; import java.awt.Container; import java.awt.GridLayout; import java.awt.FlowLayout; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JTextField; public class TelaCadastroLocacao extends JFrame { JMenuItem menuItemAbrir = new JMenuItem("Abrir"); JMenuItem menuItemNovo = new JMenuItem("Novo"); JMenuItem menuItemSalvar = new JMenuItem("Salvar"); JMenuItem menuItemExportar = new JMenuItem("Exportar"); JMenuItem menuItemFechar = new JMenuItem("Fechar"); JMenuItem menuItemColar = new JMenuItem("Colar"); JMenuItem menuItemCopiar = new JMenuItem("Copiar"); JMenuItem menuItemRecortar = new JMenuItem("Recortar"); JMenuItem menuItemSubstituir = new JMenuItem("Substituir"); JMenuItem menuItemLocalizar = new JMenuItem("Localizar"); JMenuItem menuItemOpcoesAvancadas = new JMenuItem("Opções Avançadas"); JMenuItem menuItemTutoriais = new JMenuItem("Tutoriais"); JMenuItem menuItemContato = new JMenuItem("Contato"); JMenuItem menuItemAtualizacoes = new JMenuItem("Updates"); JMenuItem menuItemLogin = new JMenuItem("Login"); JMenuItem menuItemLogout = new JMenuItem("Sair"); JMenu menuArquivo = new JMenu("Arquivo"); JMenu menuEditar = new JMenu("Editar"); JMenu menuOpcoes = new JMenu("Opções"); JMenu menuAjuda = new JMenu("Ajuda"); JMenu menuSobre = new JMenu("Sobre"); JMenu menuConta = new JMenu("Conta"); JMenuBar menuBar = new JMenuBar(); JTextField campoNomeCliente = new JTextField(); JTextField campoDiasLocacao = new JTextField(); JTextField campoDiasParaDevolucao = new JTextField(); JTextField campoModeloCarro = new JTextField(); JTextField campoMarcaCarro = new JTextField(); JTextField campoCorCarro = new JTextField(); JLabel nomeCliente = new JLabel("Nome Cliente:"); JLabel diasLocacao = new JLabel("Dias de Locacao:"); JLabel diasParaDevolucao = new JLabel("Dias Para Devolucao:"); JLabel modeloCarro = new JLabel("Modelo do Carro:"); JLabel marcaCarro = new JLabel("Marca do Carro:"); JLabel corCarro = new JLabel("Cor do Carro:"); JTextArea textArea = new JTextArea("Comentários", 10, 20); JScrollPane scrollPane = new JScrollPane(textArea); JButton oK = new JButton("OK"); JButton cancelarCadastro = new JButton("Cancelar"); public TelaCadastroLocacao(String titulo) { super(titulo); } private void mostrarTela() { menuArquivo.add(menuItemAbrir); menuArquivo.add(menuItemNovo); menuArquivo.add(menuItemSalvar); menuArquivo.add(menuItemExportar); menuArquivo.addSeparator(); menuArquivo.add(menuItemFechar); menuEditar.add(menuItemColar); menuEditar.add(menuItemCopiar); menuEditar.add(menuItemRecortar); menuEditar.addSeparator(); menuEditar.add(menuItemLocalizar); menuEditar.add(menuItemSubstituir); menuOpcoes.add(menuItemOpcoesAvancadas); menuAjuda.add(menuItemTutoriais); menuSobre.add(menuItemAtualizacoes); menuSobre.add(menuItemContato); menuConta.add(menuItemLogin); menuConta.add(menuItemLogout); menuBar.add(menuArquivo); menuBar.add(menuEditar); menuBar.add(menuOpcoes); menuBar.add(menuAjuda); menuBar.add(menuSobre); menuBar.add(menuConta); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLayout(new FlowLayout()); Container cp = getContentPane(); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(3, 3)); panel.add(nomeCliente); panel.add(campoNomeCliente); panel.add(diasLocacao); panel.add(campoDiasLocacao); panel.add(diasParaDevolucao); panel.add(campoDiasParaDevolucao); panel.add(modeloCarro); panel.add(campoModeloCarro); panel.add(marcaCarro); panel.add(campoMarcaCarro); panel.add(corCarro); panel.add(campoCorCarro); cp.add(panel); JPanel panel2 = new JPanel(); panel2.setLayout(new GridLayout(2, 2)); panel2.add(textArea); cp.add(panel2); JPanel panel3 = new JPanel(); panel3.setLayout(new GridLayout(4, 1)); panel3.add(oK); panel3.add(cancelarCadastro); cp.add(panel3); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); pack(); this.setSize(600, 350); this.setJMenuBar(menuBar); this.setVisible(true); this.setResizable(false); } public static void main(String[] args) { TelaCadastroLocacao executar = new TelaCadastroLocacao("Cadastro Locação"); executar.mostrarTela(); } }
<gh_stars>1-10 package levenshteinsearch func (dictionary *Dictionary) SearchAll(searchedTerm string, distanceMax int) map[string]*WordInformation { // Create the Automaton automaton := CreateAutomaton(searchedTerm, distanceMax) // Start the search state := automaton.Start() results := map[string]*WordInformation{} dictionary.Root.searchAll(automaton, "", nil, state, &results) return results } func (trie *RuneTrie) searchAll(automaton *LevenshteinAutomaton, prefix string, nodeCharacter *rune, automatonState AutomatonState, results *map[string]*WordInformation) { var newState AutomatonState currentWord := "" // The first character will be null for the root if nodeCharacter != nil { // Add the given char to the state newState = automaton.Step(automatonState, *nodeCharacter) // If the state can't match, stop here if !automaton.CanMatch(newState) { return } // Compute the current word currentWord = prefix + string(*nodeCharacter) // If the node is a word and if the state is a match, add it to the result if (trie.information != nil) && automaton.IsMatch(newState) { (*results)[currentWord] = trie.information } } else { newState = automaton.Start() } // Do the children for character, child := range trie.children { child.searchAll(automaton, currentWord, &character, newState, results) } }
#!/bin/bash export AMBERHOME="/usr/local/programs/custom/amber/amber14/arch/gcc-mpich3.1.3/amber14" WORKDIR="/home/leskoura/coronaZINC/ZINC/I/RESP-FULL-HIGH-MONOHAL/ZINC00033275/mod2_remake/" cd $WORKDIR input="ANTECHAMBER_RESP2_mod.IN" output="output" punch="punch" qin="../mod1_remake/qout" qout="qout" espot="../mod1_remake/ANTECHAMBER_modifikovany.ESP" esout="esout" ${AMBERHOME}/bin/resp -i $input -o $output -p $punch -q $qin -t $qout -e $espot -s $esout
def find_max(arr): max_val = arr[0] for i in range(1, len(arr)): if arr[i] > max_val: max_val = arr[i] return max_val
import React from 'react'; import mockAxios from 'jest-mock-axios'; import {DrillDownRunModal} from './drillDownRunModal'; describe('DrillDownRunModal', () => { let wrapper = null; const runId = 2; const handleCloseMock = jest.fn(); const status = 'COMPLETED'; const dbInfo = {key: 'default', name: 'test_db'}; console.error = jest.fn(); beforeEach(() => { wrapper = shallow( <DrillDownRunModal shouldShow runId={runId} handleClose={handleCloseMock} dbInfo={dbInfo} status={status} localStorageKey='default|view|2'/> ); }); afterEach(() => { // Cleaning up the mess left behind the previous test mockAxios.reset(); jest.clearAllMocks(); wrapper = null; }); it('should render correctly', async () => { expect(wrapper).toMatchSnapshot(); }); });
<gh_stars>0 REM Error.sql REM Chapter 1, Oracle9i PL/SQL Programming by <NAME> REM This block illustrates some of the error-handling features REM of PL/SQL. DECLARE v_ErrorCode NUMBER; -- Code for the error v_ErrorMsg VARCHAR2(200); -- Message text for the error v_CurrentUser VARCHAR2(8); -- Current database user v_Information VARCHAR2(100); -- Information about the error BEGIN /* Code that processes some data here */ EXCEPTION WHEN OTHERS THEN -- Assign values to the log variables, using built-in -- functions. v_ErrorCode := SQLCODE; v_ErrorMsg := SQLERRM; v_CurrentUser := USER; v_Information := 'Error encountered on ' || TO_CHAR(SYSDATE) || ' by database user ' || v_CurrentUser; -- Insert the log message into log_table. INSERT INTO log_table (code, message, info) VALUES (v_ErrorCode, v_ErrorMsg, v_Information); END; /
<filename>src/utils/http/http.js import axios from 'axios'; /** * @doc 处理请求异常 * @param error * @returns {null} */ function handleAxiosRequestExceptionDefault (error) { if (error) { const msg = `${error.config.method} '${error.config.url}' exception: ${error.message}${error.response && error.response.data ? ', ' + error.response.data : ''}`; // do something to notify console.error(msg); console.info(error); return error; } } /** * @doc 处理返回结果 * @param response * @param callback * @returns {*} */ function handleAxiosResponseDefault (response, callback) { if (response.data) { if (response.data.success) { callback && callback(response.data); return response.data; } else { const msg = `${response.config.method} '${response.config.url}' error: ${response.data.msg}`; // do something to notify console.error(msg); return response; } } else { const msg = `${response.config.method} '${response.config.url}' exception: ${response.message}${response.response && response.response.data ? ', ' + response.response.data : ''}`; // do something to notify console.error(msg); console.info(response); return response; } } export default { initialized: false, http: axios.create(), // 允许的请求方法 allowMethod: ['get', 'post'], /** * 默认处理请求异常处理函数 */ handleAxiosRequestExceptionDefault: handleAxiosRequestExceptionDefault, /** * 默认请求响应处理函数 */ handleAxiosResponseDefault: handleAxiosResponseDefault, /** * 初始化http工具 * @param apiConfig * @param handleAxiosRequestException 请求时异常处理方法 * @param handleAxiosResponse 请求正常情况的处理方法 */ initHttp (apiConfig, handleAxiosRequestException, handleAxiosResponse) { if (this.initialized) return this.http; const axios = this.http; // 1. 设置基础url axios.defaults.baseURL = apiConfig.getApiServerUrl(); // 2. 设置超时时间 if (apiConfig.timeout > 0) { axios.defaults.timeout = apiConfig.timeout; } // if (apiConfig.withCredentials) { axios.defaults.withCredentials = true } // 3. 设置错误处理方法 handleAxiosRequestException = handleAxiosRequestException || handleAxiosRequestExceptionDefault; handleAxiosResponse = handleAxiosResponse || handleAxiosResponseDefault; // 请求拦截器 axios.interceptors.request.use( config => { return config; }, error => { handleAxiosRequestExceptionDefault(error); return Promise.reject(error); } ); // 添加一个响应拦截器 axios.interceptors.response.use( function (res) { return handleAxiosResponse(res); }, function (error) { handleAxiosRequestExceptionDefault(error); return Promise.resolve(error); } ); this.http = axios; this.initialized = true; return this; }, get (url, params, callback) { return this.http.get(url, {params: params}); }, post (url, params, callback, config) { return this.http.post(url, params, config); }, /** * @doc 根据配置生成api方法 * @param source url * @param serverBasePath 基础地质 * @param target 绑定目标 * @param requestMethod 请求类型,get、post等 */ makeApiMethod (source, serverBasePath = '', target, requestMethod) { const getApiNames = Object.keys(source); getApiNames.forEach(apiName => { // 生成一个方法,params为参数,callback为回调函数,config为调用的其他配置 target[apiName] = (params, callBack, config) => { requestMethod = this.allowMethod.includes(requestMethod) != null ? requestMethod : this.allowMethod[0]; // method = 'get'; // axios调用get时,需要包一层{params: param},这里统一一下 if (requestMethod === 'get') { params = {params: params}; } return this[requestMethod](serverBasePath + source[apiName], params, callBack, config); } }); } };
let stringArray = ["Hello", "World", "!"]; stringArray.sort(); console.log(stringArray);
<gh_stars>0 import dsl print ("API Version: " + dsl.getVersion())
def group_similar(items): # Create empty groups groups = [] for item in items: is_grouped = False for group in groups: # Compute similarity to other groups similarity = compute_similarity(item, group) if similarity > 0.8: group.append(item) is_grouped = True break # If item is not grouped, create new group if not is_grouped: groups.append([item]) return groups
package mechconstruct.proxy; import mechconstruct.gui.GuiAssembler; import mechconstruct.gui.GuiAssemblerServer; import mechconstruct.gui.blueprint.elements.Element; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class MechClient extends MechCommon { private GuiAssembler guiAssembler = new GuiAssembler(); @Override public void preInit(FMLPreInitializationEvent event) { super.preInit(event); } @Override public void init(FMLInitializationEvent event) { super.init(event); } @Override public void postInit(FMLPostInitializationEvent event) { super.postInit(event); } public GuiAssemblerServer getGuiAssembler() { return guiAssembler; } public void clientCalls(Element element) { element.clientCalls(); } @Override public World getClientWorld() { return Minecraft.getMinecraft().world; } @Override public EntityPlayer getClientPlayer() { return Minecraft.getMinecraft().player; } }
from __future__ import annotations import json import os from pathlib import Path from typing import Optional, Tuple, Any, List, Dict, Union import rdflib from cfpq_data.config import RELEASE_INFO, MAIN_FOLDER from cfpq_data.src.graphs.graph_interface import IGraph from cfpq_data.src.utils.rdf_graphs_downloader import download_data from cfpq_data.src.utils.rdf_helper import write_to_rdf, add_rdf_edge from cfpq_data.src.utils.utils import unpack_graph class RDF(IGraph): """ RDF — fixed versions of real-world RDF files (links are provided for updating purposes only!) - graphs: already built graphs - graph_keys: reserved graph names - config: default edge configuration """ graphs: Dict[Tuple[str, str], Path] = dict() graph_keys: Dict[str, str] = RELEASE_INFO['RDF'] def __init__(self): """ Generic constructor - type: type of graph instance - store: stored rdflib graph - path: absolute path to graph - dirname: absolute path to graph directory - basename: graph file - vertices_number: number of vertices in the graph - edges_number: number of edges in the graph - file_size: size of graph file, in bytes - file_name: name of graph file - file_extension: extension of graph file """ self.type: Optional[str] = None self.store: Optional[rdflib.Graph] = None self.path: Optional[Path] = None self.dirname: Optional[Path] = None self.basename: Optional[str] = None self.vertices_number: Optional[int] = None self.edges_number: Optional[int] = None self.file_size: Optional[int] = None self.file_name: Optional[str] = None self.file_extension: Optional[str] = None @classmethod def build(cls, *args: Union[Path, str], source_file_format: str = 'rdf', config: Optional[Dict[str, str]] = None) -> RDF: """ An RDF graph builder :param args: args[0] - path to graph or reserved graph name, args[1] (optional) - graph file extension :type args: Union[Path, str] :param source_file_format: graph format ('txt'/'rdf') :type source_file_format: str :param config: edge configuration :type config: Optional[Dict[str, str]] :return: RDF graph instance :rtype: RDF """ source = args[0] if source_file_format == 'txt': graph = cls.load_from_txt(source, config) else: graph = cls.load_from_rdf(source) graph.save_metadata() cls.graphs[(graph.basename, graph.file_extension)] = graph.path return graph @classmethod def load(cls, source: Union[Path, str], source_file_format: str = 'rdf', config: Optional[Dict[str, str]] = None) -> RDF: """ Loads RDF graph from specified source with specified source_file_format :param source: graph source :type source: Optional[Union[Path, str]] :param source_file_format: graph format ('txt'/'rdf') :type source_file_format: str :param config: edge configuration :type config: Optional[Dict[str, str]] :return: loaded graph :rtype: RDF """ if source_file_format == 'txt': rdf_graph = cls.load_from_txt(source, config) else: rdf_graph = cls.load_from_rdf(source) return rdf_graph def save(self, destination: Union[Path, str], destination_file_format: str = 'rdf', config: Optional[Dict[str, str]] = None) -> Path: """ Saves RDF graph to destination with specified destination_file_format and edge configuration :param destination: path to save the graph :type destination: Optional[Union[Path, str]] :param destination_file_format: graph format :type destination_file_format: str :param config: edges configuration :type config: Optional[Dict[str, str]] :return: path to saved graph :rtype: Path """ if destination is None: destination = MAIN_FOLDER / 'data' / self.type / 'Graphs' / self.basename if destination_file_format == 'txt': self.save_to_txt(destination, config) else: self.save_to_rdf(destination) return destination def get_metadata(self) -> Dict[str, str]: """ Generates RDF graph metadata :return: metadata :rtype: Dict[str, str] """ return { 'name': str(self.basename), 'path': str(self.path), 'version': RELEASE_INFO['version'], 'vertices': self.vertices_number, 'edges': self.edges_number, 'size of file': self.file_size } def save_metadata(self) -> Path: """ Saves metadata to specified file :return: path to file with graph metadata :rtype: Path """ metadata_file_path = self.dirname / f'{self.file_name}_meta.json' with open(metadata_file_path, 'w') as metadata_file: json.dump(self.get_metadata(), metadata_file, indent=4) return metadata_file_path def get_triples(self) -> List[Tuple[Any, Any, Any]]: """ Returns edges as list of triples (subject, predicate, object) :return: edges :rtype: List[Tuple[Any, Any, Any]] """ triples = list() for subj, pred, obj in self.store: triples.append((subj, pred, obj)) return triples @classmethod def load_from_rdf(cls, source: Path = None) -> RDF: """ Loads RDF graph from specified source with rdf format :param source: graph source :type source: Path :return: loaded graph :rtype: RDF """ if hasattr(cls, 'graph_keys') and source in cls.graph_keys: graph_name = source[:] download_data(cls.__name__, graph_name, cls.graph_keys[graph_name]) source = unpack_graph(cls.__name__, graph_name) graph = cls() graph.type = cls.__name__ graph.store = rdflib.Graph() graph.store.parse(location=str(source), format='xml') graph.path = Path(source) graph.dirname = Path(os.path.dirname(source)) graph.basename = os.path.basename(source) graph.vertices_number = len(graph.store.all_nodes()) graph.edges_number = len(graph.store) graph.file_size = os.path.getsize(source) graph.file_name, graph.file_extension = os.path.splitext(graph.basename) return graph @classmethod def load_from_txt(cls, source: Path = None, config: Optional[Dict[str, str]] = None) -> RDF: """ Loads RDF graph from specified source with txt format :param source: graph source :type source: Path :param config: edge configuration :type config: Optional[Dict[str, str]] :return: loaded graph :rtype: RDF """ tmp_graph = rdflib.Graph() if config is None: config = dict() with open(source, 'r') as input_file: for edge in input_file: s, p, o = edge.strip('\n').split(' ') p_text = p if not p.startswith('http'): p_text = f'http://yacc/rdf-schema#{p_text}' config[p] = p_text with open(source, 'r') as input_file: for edge in input_file: s, p, o = edge.strip('\n').split(' ') add_rdf_edge(s, config[p], o, tmp_graph) write_to_rdf(Path('tmp.xml'), tmp_graph) graph = cls.load_from_rdf(Path('tmp.xml')) # os.remove('tmp.xml') return graph def save_to_rdf(self, destination: Path) -> Path: """ Saves RDF graph to destination rdf file :param destination: path to save the graph :type destination: Path :return: path to saved graph :rtype: Path """ write_to_rdf(destination, self.store) return destination def save_to_txt(self, destination: Path, config: Optional[Dict[str, str]] = None) -> Path: """ Saves RDF graph to destination txt file with specified edge configuration :param destination: path to save the graph :type destination: Path :param config: edges configuration :type config: Optional[Dict[str, str]] :return: path to saved graph :rtype: Path """ vertices = dict() edges = dict() next_id = 0 triples = list() if config is None: config = dict() for subj, pred, obj in self.store: p_text = str(pred) config[p_text] = p_text for subj, pred, obj in self.store: for tmp in [subj, obj]: if tmp not in vertices: vertices[tmp] = next_id next_id += 1 p_text = str(pred) if p_text in config: edges[p_text] = config[p_text] else: edges[p_text] = 'other' triples.append((vertices[subj], edges[str(pred)], vertices[obj])) with open(destination, 'w') as output_file: for s, p, o in triples: output_file.write(f'{s} {p} {o}\n') return destination
import { Fulfillment } from "./fulfillment"; import { LineItem } from "./line-item"; export declare class FulfillmentItem { fulfillment_id: string; item_id: string; fulfillment: Fulfillment; item: LineItem; quantity: number; } /** * @schema fulfillment_item * title: "Fulfillment Item" * description: "Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item." * x-resourceId: fulfillment_item * properties: * fulfillment_id: * description: "The id of the Fulfillment that the Fulfillment Item belongs to." * type: string * item_id: * description: "The id of the Line Item that the Fulfillment Item references." * type: string * item: * description: "The Line Item that the Fulfillment Item references." * anyOf: * - $ref: "#/components/schemas/line_item" * quantity: * description: "The quantity of the Line Item that is included in the Fulfillment." * type: integer */
#! /bin/bash source version.sh rm v$VERSION.zip rm -rf USD-$VERSION rm -rf build rm *.yml rm *.md rm -rf build_scripts rm -rf cmake rm -rf *.txt rm -rf extras rm -rf pxr rm -rf third_party rm -rf *.pdf
$(document).ready(function () { var header = ""; header += '<div id="header">'; header += '<div id="logo-area"><a href="Home.html">Stone <span class="logo2">&amp; Slate</span></a></div>'; header += '<div id="cart-link"><a href="Cart.html"><span>View Cart: 0 items</span></a></div>'; header += '<div id="links-area"><ul><li><a class="myaccountlink" href="MyAccount.html"><span>My Account</span></a></li>'; header += '<li><a class="signinlink" href="SignIn.html"><span>Sign In</span></a></li>'; header += '<li><a class="contactlink" href="Checkout.html"><span>Checkout</span></a></li></ul></div>'; header += '<div id="search-form"><div class="searchform"><input type="textbox" id="headersearchbox"> <a href="#" id="headersearchlink"><span>Search</span></a></div></div>'; header += '<div id="header-menu">'; header += '<ul>'; header += '<li class="activemainmenuitem"><a href="Category.html" tabindex="0" class="actuator" title="Sample Category of Products"><span>Sample Products</span></a></li>'; header += '<li><a href="Category.html" tabindex="1" class="actuator" title="More Sample Products"><span>More Sample</span></a></li>'; header += '<li><a href="Category.html" tabindex="2" class="actuator" title=""><span>Demo Category</span></a></li>'; header += '<li><a href="CustomPage.html" tabindex="3" class="actuator" title=""><span>About Us</span></a></li></ul>'; header += '</div>'; header += '</div>'; $('#dynamicheader').replaceWith(header); });
<reponame>doctorub44/graphprocessor package graphproc import ( "errors" "fmt" "reflect" "runtime" "strconv" "strings" deepcopy "github.com/barkimedes/go-deepcopy" ) //Stage : graph execution stage type type Stage struct { name string sfunc func(*State, *Payload) error state *State preasp map[string]*Aspect postasp map[string]*Aspect } //State : graph stage state type type State struct { config interface{} appstate interface{} } //Payload : graph stage payload type type Payload struct { Raw []byte Data interface{} } //Graphline : map with the set of graphs and map of application stages used in the graphs type Graphline struct { graphs map[string]*Graph appstage map[string]func(*State, *Payload) error } var publicgraphs *Graphline //NewGraphline : create a new graphline func NewGraphline() Graphline { var g Graphline g.graphs = make(map[string]*Graph) g.appstage = make(map[string]func(*State, *Payload) error) return g } //PublishGraphs : publish the graphline if needed elsewhere (subgraph execution stage) func (g *Graphline) PublishGraphs() { publicgraphs = g } //PublicGraphs : return the graphline that was published func PublicGraphs() *Graphline { return publicgraphs } //NewState : create a state type func NewState() *State { s := new(State) s.config = make(map[string]interface{}) return s } //NewPayload : create a new payload type func NewPayload() *Payload { p := new(Payload) p.Raw = make([]byte, 0, 2048) return p } //NewStage : create and new graph execution stage type func NewStage() *Stage { s := new(Stage) s.preasp = make(map[string]*Aspect) s.postasp = make(map[string]*Aspect) return s } //Config : get a field value when using the convention of map of interface values func (s *State) Config(field string) (string, bool) { if f, ok := s.config.(map[string]interface{})[field].(string); ok { return f, true } return "", false } //SetConfig : set a field value when using the convention of map of interface values func (s *State) SetConfig(field string, value interface{}) { s.config.(map[string]interface{})[field] = value } //funcName : returns a string for the name of a func in form <package>.<func name> func funcName(i interface{}) string { return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name() } //callerName : return name of the calling function //func callerName(index int) string { // pc, _, _, _ := runtime.Caller(index) // details := runtime.FuncForPC(pc) // return details.Name() //} //Copy : deep copy the src payload to the destination payload func (p *Payload) Copy(dest, src *Payload) (*Payload, error) { var err error err = nil dest.Raw = append(dest.Raw[:0], src.Raw...) if src.Data != nil { dest.Data, err = deepcopy.Anything(src.Data) } return dest, err } //Append : deep append the src payload to the destination payload. Data field must be map or slice func (p *Payload) Append(dest, src *Payload) (*Payload, error) { var err error dest.Raw = append(dest.Raw, src.Raw...) if src.Data != nil { if reflect.TypeOf(src.Data).Kind() == reflect.Slice { dest.Data = reflect.AppendSlice(reflect.ValueOf(dest.Data), reflect.ValueOf(src.Data)) } else if reflect.TypeOf(src.Data).Kind() == reflect.Map { dest.Data, err = appendMap(dest.Data, src.Data) if err != nil { return nil, err } } else { return nil, errors.New("Append: source type invalid - must be slice or map") } } return dest, nil } //SetData : set the data field when using convention of map of interface values func (p *Payload) SetData(key string, value interface{}) error { if p.Data == nil { p.Data = make(map[string]interface{}) } p.Data.(map[string]interface{})[key] = value return nil } //GetData : get the data field when using convention of map of interface values func (p *Payload) GetData(key string) (interface{}, error) { if value, ok := p.Data.(map[string]interface{})[key]; ok { return value, nil } return nil, errors.New("GetData: key not found in payload data") } //appendMap : does a deep append of the source map to destination map func appendMap(dest, src interface{}) (interface{}, error) { newmap := make(map[string]interface{}) iter := reflect.ValueOf(src).MapRange() for iter.Next() { newmap[iter.Key().String()] = iter.Value() } iter = reflect.ValueOf(dest).MapRange() for iter.Next() { newmap[iter.Key().String()] = iter.Value() } return newmap, nil } //RegisterStage : register an application stage function for use in a graph func (g *Graphline) RegisterStage(sfunc func(*State, *Payload) error) error { fields := strings.Split(funcName(sfunc), ".") aname := fields[len(fields)-1] if _, aok := g.appstage[aname]; !aok { g.appstage[aname] = sfunc } return nil } //RegisterAspect : register an application aspect function for use in a graph func (g *Graphline) RegisterAspect(graphid string, action AspectAction, stage func(*State, *Payload) error, newasp *Aspect) error { graph := g.graphs[graphid] for _, vertex := range graph.Path { s := vertex.Vstage if stage == nil || funcName(s.sfunc) == funcName(stage) { aspname := funcName(newasp.aspect) if action == START { if a, ok := s.preasp[s.name]; !ok { s.preasp[aspname] = newasp } else if funcName(a.aspect) != aspname { s.preasp[aspname] = newasp } } else if action == END { if a, ok := s.postasp[s.name]; !ok { s.postasp[aspname] = newasp } else if funcName(a.aspect) != aspname { s.postasp[aspname] = newasp } } else { return errors.New("RegisterAspect: illegal action passed, must be START or END : " + strconv.Itoa(int(action))) } if stage != nil { //if nil stage not specified, return, otherwise apply aspect to all stages return nil } } } return nil } // Sequence : parse and generate the execution sequence for a graph specification func (g *Graphline) Sequence(graphspec string) ([]string, error) { if strings.TrimSpace(graphspec) == "" { return nil, errors.New("Sequence: no graph specification provided ") } gnames, graphs, err := (NewParser(strings.NewReader(graphspec))).Parse() if err == nil { for i, graph := range graphs { graph.BuildPath() g.graphs[gnames[i]] = graph for _, vertex := range graph.Path { if sfunc, aok := g.appstage[vertex.Name]; aok { vertex.Vstage.sfunc = sfunc vertex.Vstage.name = vertex.Name } else { return nil, errors.New("Sequence: no registered stage found for " + vertex.Name) } } } } else { return nil, err } return gnames, nil } //PrintPath : print the path for diagnostic purposes func (g *Graphline) PrintPath(graphid string) { graph := g.graphs[graphid] for _, v := range graph.Path { fmt.Println(v.Name) } } //Execute : execute a graph based on its name func (g *Graphline) Execute(gname string, payload *Payload) error { var err, serr error graph := g.graphs[gname] scope := new(Scope) for _, vertex := range graph.Path { stage := vertex.Vstage name := funcName(stage.sfunc) if stage.sfunc != nil { //Execute pre aspects for this stage if err = g.RunAspects(name, payload.Raw, scope, stage.preasp); err != nil { return err } if vertex.joined == 0 { //First vertex in graph so no input data, execute the vertex } else if vertex.joined == 1 { // Only a single edge with input data, copy the input and execute the vertex payload, err = payload.Copy(payload, vertex.Prev[0].Epayload) if err != nil { return err } } else if vertex.joined == vertex.produced { //All edges have produced input data, aggregate the inputs payload.Raw = payload.Raw[:0] for _, e := range vertex.Prev { payload, err = payload.Append(payload, e.Epayload) if err != nil { return err } } } else if vertex.joined != vertex.produced { //Not all edges have input data so the vertex is not ready to execute, continue to next vertex in path continue } //Execute the stage function if serr = stage.sfunc(stage.state, payload); serr == nil { for _, edge := range vertex.Next { // Copy the output to each output edge edge.Epayload, err = payload.Copy(edge.Epayload, payload) if err != nil { return err } edge.Out.produced++ } } else { return serr } //Execute post aspects for this stage if err = g.RunAspects(name, payload.Raw, scope, stage.postasp); err != nil { return err } } else { break } } return nil } //SetState : deprecated func (g *Graphline) SetState(gname string, name string, state *State) (int, error) { graph := g.graphs[gname] for i, v := range graph.V { if name == v.Name { v.Vstage.state = state graph.V[i] = v return 0, nil } } return -1, errors.New("SetStage: no registered stage found for " + name) } //CallStage : deprecated func (g *Graphline) CallStage(graphid string, name string, state *State) (int, error) { var err error graph := g.graphs[graphid] for i, v := range graph.V { if name == v.Name { err = v.Vstage.sfunc(state, nil) graph.V[i] = v return i, err } } return -1, errors.New("CallStage: no registered stage found for " + name) } //RunAspects : run the aspects for a graph stage func (g *Graphline) RunAspects(name string, mesg []byte, scope *Scope, asp map[string]*Aspect) error { for _, aspect := range asp { if aspect != nil { if action := aspect.Execute(name, mesg, scope); action == ERROR { return errors.New("RunAspects: error returned by execution aspect") } } else { break } } return nil } //BuildState func (s *Stage) BuildState(cfg interface{}) { if s.state == nil { s.state = new(State) } s.state.config = cfg }
JAR=`ls /archive/ais-lib-cli/target/ais-lib-cli*SNAPSHOT.jar` echo "Running: " echo "java -jar $JAR filedump $SOURCES -directory $DIRECTORY" java -jar $JAR filedump $SOURCES -directory $DIRECTORY
#!/bin/bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. MXNET_ROOT=$(cd "$(dirname $0)/../../.."; pwd) CLASS_PATH=$MXNET_ROOT/scala-package/assembly/linux-x86_64-gpu/target/*:$MXNET_ROOT/scala-package/examples/target/*:$MXNET_ROOT/scala-package/examples/target/classes/lib/* # which gpu card to use, -1 means cpu GPU=$1 # the mnist data path # you can get the mnist data using the script core/scripts/get_mnist_data.sh MNIST_DATA_PATH=$2 # the path to save the generated results OUTPUT_PATH=$3 java -Xmx4G -cp $CLASS_PATH \ org.apache.mxnetexamples.gan.GanMnist \ --mnist-data-path $MNIST_DATA_PATH \ --gpu $GPU \ --output-path $OUTPUT_PATH
CUDA_VISIBLE_DEVICES=1 python train.py --dataroot /data2/victorleee/grid/ --name tellgan_ver1 --model tell_gan --continue_train
package com.javatest.javassist; import javassist.ClassPool; import javassist.CtClass; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.FileOutputStream; import java.io.OutputStream; public class JavassistMain { public static final Logger LOG = LoggerFactory.getLogger(JavassistMain.class); public static void main(String []args) { ClassPool pool = ClassPool.getDefault(); try { CtClass cc = pool.get("com.javatest.javassist.Rectangle"); cc.setSuperclass(pool.get("com.javatest.javassist.Point")); // 将修改后的字节码写入文件 // cc.writeFile(); cc.writeFile("/Users/yangshengbing/Documents/idea_java/example/javatest/target/classes"); // 将修改后的字节码写入文件,这个文件的内容与上面文件的内容应该一样 byte[] b = cc.toBytecode(); OutputStream o = new FileOutputStream("/Users/yangshengbing/Documents/idea_java/example/javatest/target/classes/com/javatest/javassist/test.class"); o.write(b); o.close(); // 加载修改后的类,并获取它的父类 Class clazz = cc.toClass(); LOG.info("{}", clazz.getSuperclass().getName()); CtClass newCtClass = pool.makeClass("com.javatest.javassist.Circle"); newCtClass.writeFile("/Users/yangshengbing/Documents/idea_java/example/javatest/target/classes"); } catch (Exception e) { e.printStackTrace(); } } }
# # Working directory # # Current directory. Return only three last items of path # ------------------------------------------------------------------------------ # Configuration # ------------------------------------------------------------------------------ SPACESHIP_DIR_SHOW="${SPACESHIP_DIR_SHOW=true}" SPACESHIP_DIR_PREFIX="${SPACESHIP_DIR_PREFIX="in "}" SPACESHIP_DIR_SUFFIX="${SPACESHIP_DIR_SUFFIX="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"}" SPACESHIP_DIR_TRUNC="${SPACESHIP_DIR_TRUNC=3}" SPACESHIP_DIR_TRUNC_PREFIX="${SPACESHIP_DIR_TRUNC_PREFIX=}" SPACESHIP_DIR_TRUNC_REPO="${SPACESHIP_DIR_TRUNC_REPO=true}" SPACESHIP_DIR_COLOR="${SPACESHIP_DIR_COLOR="cyan"}" if [[ $SPACESHIP_PROMPT_SYMBOLS_SHOW == true ]]; then SPACESHIP_DIR_LOCK_SYMBOL="${SPACESHIP_DIR_LOCK_SYMBOL=" "}" fi SPACESHIP_DIR_LOCK_COLOR="${SPACESHIP_DIR_LOCK_COLOR="red"}" # ------------------------------------------------------------------------------ # Section # ------------------------------------------------------------------------------ spaceship_dir() { [[ $SPACESHIP_DIR_SHOW == false ]] && return local 'dir' 'trunc_prefix' # Threat repo root as a top-level directory or not if [[ $SPACESHIP_DIR_TRUNC_REPO == true ]] && spaceship::is_git; then local git_root=$(git rev-parse --show-toplevel) if (cygpath --version) >/dev/null 2>/dev/null; then git_root=$(cygpath -u $git_root) fi # Check if the parent of the $git_root is "/" if [[ $git_root:h == / ]]; then trunc_prefix=/ else trunc_prefix=$SPACESHIP_DIR_TRUNC_PREFIX fi # `${NAME#PATTERN}` removes a leading prefix PATTERN from NAME. # `$~~` avoids `GLOB_SUBST` so that `$git_root` won't actually be # considered a pattern and matched literally, even if someone turns that on. # `$git_root` has symlinks resolved, so we use `${PWD:A}` which resolves # symlinks in the working directory. # See "Parameter Expansion" under the Zsh manual. dir="$trunc_prefix$git_root:t${${PWD:A}#$~~git_root}" else if [[ SPACESHIP_DIR_TRUNC -gt 0 ]]; then # `%(N~|TRUE-TEXT|FALSE-TEXT)` replaces `TRUE-TEXT` if the current path, # with prefix replacement, has at least N elements relative to the root # directory else `FALSE-TEXT`. # See "Prompt Expansion" under the Zsh manual. trunc_prefix="%($((SPACESHIP_DIR_TRUNC + 1))~|$SPACESHIP_DIR_TRUNC_PREFIX|)" fi dir="$trunc_prefix%${SPACESHIP_DIR_TRUNC}~" fi if [[ ! -w . ]]; then SPACESHIP_DIR_SUFFIX="%F{$SPACESHIP_DIR_LOCK_COLOR}${SPACESHIP_DIR_LOCK_SYMBOL}%f${SPACESHIP_DIR_SUFFIX}" fi spaceship::section \ "$SPACESHIP_DIR_COLOR" \ "$SPACESHIP_DIR_PREFIX" \ "$dir" \ "$SPACESHIP_DIR_SUFFIX" }
<reponame>isandlaTech/cohorte-runtime /** * Copyright 2014 isandlaTech * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.cohorte.composer.isolate.ipojo; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; import org.apache.felix.ipojo.ComponentInstance; import org.apache.felix.ipojo.ConfigurationException; import org.apache.felix.ipojo.Factory; import org.apache.felix.ipojo.InstanceManager; import org.apache.felix.ipojo.InstanceStateListener; import org.apache.felix.ipojo.MissingHandlerException; import org.apache.felix.ipojo.UnacceptableConfiguration; import org.apache.felix.ipojo.annotations.Bind; import org.apache.felix.ipojo.annotations.Component; import org.apache.felix.ipojo.annotations.Instantiate; import org.apache.felix.ipojo.annotations.Invalidate; import org.apache.felix.ipojo.annotations.Provides; import org.apache.felix.ipojo.annotations.Requires; import org.apache.felix.ipojo.annotations.Unbind; import org.apache.felix.ipojo.annotations.Validate; import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler; import org.apache.felix.ipojo.metadata.Element; import org.cohorte.composer.api.ComposerConstants; import org.cohorte.composer.api.IAgent; import org.cohorte.composer.api.RawComponent; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; import org.osgi.service.log.LogService; import org.psem2m.isolates.constants.IPlatformProperties; /** * The iPOJO composer agent * * @author <NAME> */ @Component @Provides(specifications = IAgent.class) @Instantiate(name = "cohorte-composer-agent-ipojo") public class IPojoAgent implements IAgent, InstanceStateListener { /** iPOJO factories dependency ID */ private static final String IPOJO_ID_FACTORIES = "ipojo-factories"; /** The bundle context */ private final BundleContext pContext; /** Local factories: Name -&gt; iPOJO Factory */ private final Map<String, Factory> pFactories = new LinkedHashMap<String, Factory>(); /** * Maps fields names and IDs for each component type: Factory -&gt; {Field * name -&gt; ID} */ private final Map<String, Map<String, String>> pFactoriesFieldsIds = new LinkedHashMap<String, Map<String, String>>(); /** Instance name -&gt; iPOJO instance */ private final Map<String, ComponentInstance> pInstances = new LinkedHashMap<String, ComponentInstance>(); /** Host isolate name */ private String pIsolateName; /** The logger */ @Requires private LogService pLogger; /** Host node Name */ private String pNodeName; /** Factory name -&gt; Remaining components */ private final Map<String, Set<RawComponent>> pRemainingFactories = new LinkedHashMap<String, Set<RawComponent>>(); /** Instance name -&gt; Remaining component */ private final Map<String, RawComponent> pRemainingNames = new LinkedHashMap<String, RawComponent>(); /** Component validation flag */ private boolean pValidated; /** * Sets up the component * * @param aContext * The bundle context */ public IPojoAgent(final BundleContext aContext) { pContext = aContext; pValidated = false; } /** * Called by iPOJO when a Factory service is bound * * @param aFactory * A new factory service */ @Bind(id = IPOJO_ID_FACTORIES, aggregate = true, optional = true) protected synchronized void bindFactory(final Factory aFactory) { // Store the factory name (component type name) final String factoryName = aFactory.getName(); // Prepare a field -> ID map and attach it to the component type final Map<String, String> fieldIdMap = new LinkedHashMap<String, String>(); pFactoriesFieldsIds.put(factoryName, fieldIdMap); // Set up the map content final Element componentModel = aFactory.getComponentMetadata(); // @Requires elements IDs final Element[] requiresElems = componentModel.getElements(IPojoConstants.REQUIRES_ELEMENT_NAME); if (requiresElems != null) { for (final Element requires : requiresElems) { final String name = requires.getAttribute(IPojoConstants.REQUIRES_FIELD); if (name != null) { // The name is the most important part final String id = requires.getAttribute(IPojoConstants.REQUIRES_ID); fieldIdMap.put(name, id); } } } // @Temporal elements IDs final Element[] temporalElems = componentModel.getElements(IPojoConstants.TEMPORAL_ELEMENT_NAME); if (temporalElems != null) { for (final Element temporal : temporalElems) { final String name = temporal.getAttribute(IPojoConstants.TEMPORAL_FIELD); if (name != null) { // The name is the most important part final String id = temporal.getAttribute(IPojoConstants.TEMPORAL_ID); fieldIdMap.put(name, id); } } } pFactories.put(factoryName, aFactory); pLogger.log(LogService.LOG_INFO, "Factory bound: " + factoryName); if (pValidated) { // Component is valid, try instantiation final Set<RawComponent> remaining = pRemainingFactories.get(factoryName); if (remaining != null) { handle(remaining); } } } /** * Prepares the basic properties that a component and its provided service * must have * * @param aComponent * A component bean * @return The basic properties of the given component */ private Properties computeCommonProperties(final RawComponent aComponent) { // Set up common properties final Properties properties = new Properties(); // Add configured properties properties.putAll(aComponent.getProperties()); // Set up forced properties properties.put(ComposerConstants.PROP_INSTANCE_NAME, aComponent.getName()); properties.put(ComposerConstants.PROP_ISOLATE_NAME, pIsolateName); properties.put(ComposerConstants.PROP_NODE_NAME, pNodeName); return properties; } /** * Prepares the binding filters for iPOJO * * @param aComponent * A component bean * @return A dictionary Field name -&gt; LDAP filter string */ private Map<String, String> computeFilters(final RawComponent aComponent) { // Computed filters: Field -> LDAP filter final Map<String, String> filters = new LinkedHashMap<String, String>(aComponent.getFilters()); // Field -> component name final Map<String, String> fieldsWires = aComponent.getWires(); for (final Entry<String, String> entry : fieldsWires.entrySet()) { // For each field, prepare & merge filters final String field = entry.getKey(); final String wire = entry.getValue(); // Prepare the corresponding LDAP filter final String wire_filter = String.format("(%s=%s)", ComposerConstants.PROP_INSTANCE_NAME, wire); final String previous = filters.get(field); if (previous != null) { // Merge filters filters.put(field, String.format("(&%s%s)", wire_filter, previous)); } else { // Store it directly filters.put(field, wire_filter); } } return filters; } /** * Sets up the properties that must be associated to the component * * @param aComponent * A component bean * @return The component instance properties */ private Properties computeInstanceProperties(final RawComponent aComponent) { // Start with the basic properties final Properties properties = computeCommonProperties(aComponent); // Instance name properties.put(IPojoConstants.INSTANCE_NAME, aComponent.getName()); // Set up field filters final Map<String, String> fieldIdMapping = pFactoriesFieldsIds.get(aComponent.getFactory()); if (fieldIdMapping != null) { // Mapping available, use it final Properties fieldsFilters = generateFieldsFilters(aComponent, fieldIdMapping); /* * Convert fields filters to an array : it avoids an error in the * log each time a component is created... */ final String[] fieldsFiltersArray = new String[fieldsFilters.size() * 2]; int i = 0; for (final Entry<?, ?> entry : fieldsFilters.entrySet()) { fieldsFiltersArray[i++] = (String) entry.getKey(); fieldsFiltersArray[i++] = (String) entry.getValue(); } // @Requires annotations properties.put(IPojoConstants.REQUIRES_FILTERS, fieldsFiltersArray); // @Temporal annotations properties.put(IPojoConstants.TEMPORAL_FILTERS, fieldsFiltersArray); } return properties; } /** * Sets up the properties that must be associated to the service provided by * the component * * @param aComponent * A component bean * @return The service properties */ private Properties computeServiceProperties(final RawComponent aComponent) { // Start with the basic properties final Properties properties = computeCommonProperties(aComponent); // Export the service properties.put(Constants.SERVICE_EXPORTED_INTERFACES, "*"); return properties; } /** * Generates the iPOJO properties to force the filters to apply to * configured required field * * @param aComponent * A component bean * @param aFieldIdMapping * Field name -&gt; iPOJO required field ID mapping * @return The iPOJO requires.filters property value (never null) */ private Properties generateFieldsFilters(final RawComponent aComponent, final Map<String, String> aFieldIdMapping) { // Field -> LDAP Filter final Map<String, String> fieldsFilters = computeFilters(aComponent); // Set requires.filter property final Properties requiresFilterProperties = new Properties(); for (final Entry<String, String> fieldIdEntry : aFieldIdMapping.entrySet()) { // Field name is constant final String fieldName = fieldIdEntry.getKey(); // Use the field ID if possible, else the field name String fieldId = fieldIdEntry.getValue(); if (fieldId == null) { fieldId = fieldName; } // Compute the field filter String filter = null; if (fieldsFilters.containsKey(fieldName)) { // Field name found filter = fieldsFilters.get(fieldName); } else if (fieldsFilters.containsKey(fieldId)) { // Field ID found filter = fieldsFilters.get(fieldId); } else { // TODO: Default : filter on the composite name } if (filter != null) { // Trim the filter for the next test filter = filter.trim(); if (!filter.isEmpty()) { // Non-empty filter, ready to be used requiresFilterProperties.put(fieldId, filter); } } } return requiresFilterProperties; } /** * Retrieves or creates the set of remaining components of the given factory * * @param aFactory * A factory name * @return The set of remaining components (never null) */ private Set<RawComponent> getRemainingByFactory(final String aFactory) { Set<RawComponent> set = pRemainingFactories.get(aFactory); if (set == null) { set = new LinkedHashSet<RawComponent>(); pRemainingFactories.put(aFactory, set); } return set; } /* * (non-Javadoc) * * @see org.cohorte.composer.api.IAgent#handle(java.util.Set) */ @Override public synchronized Set<RawComponent> handle(final Set<RawComponent> aComponents) { final Set<RawComponent> instantiated = new LinkedHashSet<RawComponent>(); Set<RawComponent> toInstantiate = new LinkedHashSet<>(aComponents); for (final RawComponent component : toInstantiate) { try { if (tryInstantiate(component)) { instantiated.add(component); } } catch (final Throwable ex) { // Instantiation error pLogger.log(LogService.LOG_ERROR, "Error instantiating component " + component + ": " + ex, ex); } } // Store the remaining components final Set<RawComponent> remaining = new LinkedHashSet<RawComponent>(toInstantiate); remaining.removeAll(instantiated); for (final RawComponent component : remaining) { getRemainingByFactory(component.getFactory()).add(component); } return instantiated; } /** * Component invalidated */ @Invalidate public synchronized void invalidate() { // Clean up values pValidated = false; pIsolateName = null; pNodeName = null; // TODO: kill all components ? } /* * (non-Javadoc) * * @see org.cohorte.composer.api.IAgent#kill(java.lang.String) */ @Override public synchronized void kill(final String aName) { final ComponentInstance instance = pInstances.remove(aName); if (instance != null) { // Kill the component instance.dispose(); pLogger.log(LogService.LOG_INFO, "Component " + aName + " disposed"); } else if (pRemainingNames.containsKey(aName)) { // Remove the entry from the remaining components final RawComponent component = pRemainingNames.remove(aName); pRemainingFactories.get(component.getFactory()).remove(component); } else { // FIXME Unknown component pLogger.log(LogService.LOG_WARNING, "Unknown component: " + aName); } } /** * Removes the given component from the remaining components maps * * @param aComponent * The component to be removed */ private void removeRemaining(final RawComponent aComponent) { // By name pRemainingNames.remove(aComponent.getName()); // By factory final Set<RawComponent> remaining = pRemainingFactories.get(aComponent.getFactory()); if (remaining != null) { remaining.remove(aComponent); } } /* * (non-Javadoc) * * @see * org.apache.felix.ipojo.InstanceStateListener#stateChanged(org.apache. * felix.ipojo.ComponentInstance, int) */ @Override public void stateChanged(final ComponentInstance aComponentInstance, final int aState) { // Get the component name final String name = aComponentInstance.getInstanceName(); if (!pInstances.containsKey(name)) { // Component is no more handled... if (aState != ComponentInstance.DISPOSED && aState != ComponentInstance.STOPPED) { // Incoherent state pLogger.log(LogService.LOG_WARNING, "Received new status " + aState + " for component " + name + " which should no longer change..."); } // Ignore return; } // TODO: handle events } /** * Tries to instantiate a component * * @param aComponent * The component to instantiate * @return True if the component has been instantiated * @throws ConfigurationException * Invalid configuration * @throws UnacceptableConfiguration * Invalid configuration */ private boolean tryInstantiate(final RawComponent aComponent) throws UnacceptableConfiguration, ConfigurationException { // Get the component factory final Factory factory = pFactories.get(aComponent.getFactory()); if (factory == null) { // Factory not available yet return false; } // Prepare properties final Properties instanceProperties = computeInstanceProperties(aComponent); final Properties serviceProperties = computeServiceProperties(aComponent); // Instantiate the component final ComponentInstance instance; try { instance = factory.createComponentInstance(instanceProperties); } catch (final MissingHandlerException ex) { // A handler is missing, try later return false; } if (instance instanceof InstanceManager) { // We can get the control of the provided service handler final InstanceManager instanceManager = (InstanceManager) instance; final ProvidedServiceHandler serviceHandler = (ProvidedServiceHandler) instanceManager .getHandler(IPojoConstants.HANDLER_PROVIDED_SERVICE); if (serviceHandler != null) { serviceHandler.addProperties(serviceProperties); } } // Register to the component events instance.addInstanceStateListener(this); // Keep a reference to this component pInstances.put(aComponent.getName(), instance); // Update the 'remaining' information removeRemaining(aComponent); return true; } /** * Called by iPOJO when a factory service is unbound * * @param aFactory * A factory service going away */ @Unbind(id = IPOJO_ID_FACTORIES) protected void unbindFactory(final Factory aFactory) { final String factoryName = aFactory.getName(); // Remove the factory from the map pFactories.remove(factoryName); } /** * Component validated */ @Validate public synchronized void validate() { // Store isolate information pIsolateName = pContext.getProperty(IPlatformProperties.PROP_ISOLATE_NAME); pNodeName = pContext.getProperty(IPlatformProperties.PROP_NODE_NAME); // Allow bindings pValidated = true; } }
def descending_order(d): for i in d.keys(): print(*sorted(d[i], reverse=True)) d = { 'Topic1': [2, 3, 6], 'Topic2': [7, 1, 5], 'Topic3': [8, 4] } descending_order(d)
def expandvol(self, urn, config): # Construct the action for expanding the volume action = '/action/expandvol' # Convert the urn to server URI server_uri = self.urn2uri(urn) # Construct the complete URI for the expandvol action uri = server_uri + action # Log the URI and configuration ctx.logger.info('uri: {}, data: {}'.format(uri, config)) # Make a POST request to the constructed URI using the provided rest_client return self.rest_client.post(uri, data=config)
import { persistStore, persistReducer } from "redux-persist" import storage from "redux-persist/lib/storage" import { rootReducer } from "./reducers" import { createStore } from "redux" const persistConfig = { key: "root", storage, } const persistedReducer = persistReducer(persistConfig, rootReducer) export const configureStore = middleware => { const store = createStore(persistedReducer, middleware) const persistor = persistStore(store) return { store, persistor } }
#!/bin/bash set -o nounset set -o errexit source ${SH_LIBRARY_PATH}/common.sh source ${SH_LIBRARY_PATH}/os-nightly-lib.sh check_env OPENZFS_DIRECTORY BUILD_NONDEBUG BUILD_DEBUG RUN_LINT # # Updates the nightly environment file. If there's a default value # provided for the variable we're attempting to set, this value is # overridden in-place. We need to modify the value of the variable, # without changing it's location in the file so we don't invalidate # any later references of the variable. If there isn't an existing # default value, then the export declaration for the variable is # simply appended to the end of environment file using the provided # value. # function nightly_env_set_var { # # The environment file is hard-coded. Since we don't use # anything other than this value, using a hard-coded value here # makes it easier on consumers since each call do this function # doesn't have to pass in the filename. # local file="illumos.sh" local variable=$1 local value=$2 # # Check and ensure the file we need is actually present. # [ -f "$file" ] || die "illumos nightly environment file '$file' not found." # # Here is how we determine if there's a default value for the # variable that we need to update in-place, or if we can append # the new value to the end of the file. # # Also note, when adding quotes around the value provided, we # need to be careful to not use single quotes. The contents of # the provided value may reference another shell variable, so we # need to make sure variable expansion will occur (it wouldn't # if we surrounding the value with single quotes). # # if /usr/bin/grep "^export $variable" "$file" >/dev/null; then # # If an existing value was found, we assign the new # value without modifying the variables location in the # file. # /usr/bin/sed -ie \ "s|^export $variable.*|export $variable=\"$value\"|" "$file" return $? else # # If a default value wasn't found, we don't need to # worry about any references to this variable in the # file, so we can simply append the value to the end of # the file. # echo "export $variable=\"$value\"" >> "$file" return $? fi } # # The illumos build cannot be run as the root user. The Jenkins # infrastructure built around running the build should ensure the build # is not attempted as root. In case that fails for whatever reason, it's # best to fail early and with a good error message, than failing later # with an obscure build error. # [ $EUID -ne 0 ] || die "build attempted as root user; this is not supported." OPENZFS_DIRECTORY=$(log_must readlink -f "$OPENZFS_DIRECTORY") log_must test -d "$OPENZFS_DIRECTORY" log_must cd "$OPENZFS_DIRECTORY" NIGHTLY_OPTIONS="-nCprt" if [[ "$BUILD_NONDEBUG" = "no" ]]; then NIGHTLY_OPTIONS+=F else [[ "$BUILD_NONDEBUG" = "yes" ]] || die "Invalid value for BUILD_NONDEBUG: $BUILD_NONDEBUG'" fi if [[ "$BUILD_DEBUG" = "yes" ]]; then NIGHTLY_OPTIONS+=D else [[ "$BUILD_DEBUG" = "no" ]] || die "Invalid value for BUILD_DEBUG: '$BUILD_DEBUG'" fi if [[ "$RUN_LINT" = "yes" ]]; then NIGHTLY_OPTIONS+=l else [[ "$RUN_LINT" = "no" ]] || die "Invalid value for RUN_LINT: '$RUN_LINT'" fi log_must wget --quiet \ https://download.joyent.com/pub/build/illumos/on-closed-bins.i386.tar.bz2 \ https://download.joyent.com/pub/build/illumos/on-closed-bins-nd.i386.tar.bz2 log_must tar xjpf on-closed-bins.i386.tar.bz2 log_must tar xjpf on-closed-bins-nd.i386.tar.bz2 if [[ -f /opt/onbld/env/omnios-illumos-gate ]]; then # # We're building on an OmniOS based system, so use the provided # illumos.sh environment file. # log_must cp /opt/onbld/env/omnios-illumos-gate illumos.sh else # # If this isn't an OmniOS system, the assumption is this is an # OpenIndiana based system. In which case, use the illumos.sh # environment file from the respository, and provided some # OpenIndiana specific customizations. # log_must cp usr/src/tools/env/illumos.sh illumos.sh PKGVERS_BRANCH=$(pkg info -r pkg://openindiana.org/SUNWcs | \ awk '$1 == "Branch:" {print $2}') log_must nightly_env_set_var "PKGVERS_BRANCH" "'$PKGVERS_BRANCH'" log_must nightly_env_set_var "ONNV_BUILDNUM" "'$PKGVERS_BRANCH'" log_must nightly_env_set_var "PERL_VERSION" "5.22" log_must nightly_env_set_var "PERL_PKGVERS" "-522" log_must nightly_env_set_var "BLD_JAVA_8" "" fi log_must nightly_env_set_var "NIGHTLY_OPTIONS" "$NIGHTLY_OPTIONS" log_must nightly_env_set_var "GATE" "openzfs-nightly" log_must nightly_env_set_var "CODEMGR_WS" "$OPENZFS_DIRECTORY" log_must nightly_env_set_var "ON_CLOSED_BINS" "$OPENZFS_DIRECTORY/closed" log_must nightly_env_set_var "ENABLE_IPP_PRINTING" "#" log_must nightly_env_set_var "ENABLE_SMB_PRINTING" "#" log_must cp usr/src/tools/scripts/nightly.sh . log_must chmod +x nightly.sh log_must nightly_run ./nightly.sh "$OPENZFS_DIRECTORY" "illumos.sh" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "Build errors" "Build warnings" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "Build warnings" "Elapsed build time" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "Build errors (non-DEBUG)" "Build warnings (non-DEBUG)" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "Build warnings (non-DEBUG)" "Elapsed build time (non-DEBUG)" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "Build errors (DEBUG)" "Build warnings (DEBUG)" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "Build warnings (DEBUG)" "Elapsed build time (DEBUG)" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "lint warnings src" "lint noise differences src" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "cstyle/hdrchk errors" "Find core files" log_must mail_msg_is_clean "$OPENZFS_DIRECTORY" "Validating manifests against proto area" "Check ELF runtime attributes" exit 0 # vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab textwidth=72 colorcolumn=80
<filename>src/unique.js import _ from 'lodash' import stringify from 'json-stable-stringify' const unique = Symbol.for('lacona-unique-key') export default unique function getUniqueValue (result) { if (!_.isObject(result)) { return result } else if (result[unique] != null) { if (_.isFunction(result[unique])) { return result[unique](result) } else { return result[unique] } } else { return stringify(result) } } export function checkAgainstUniqueSet(uniqueSet, ...results) { return !_.chain(results) .reject(result => result == null) .map(getUniqueValue) .every(value => uniqueSet.has(value)) .value() } export function checkAgainstResultList(resultList, ...results) { return !_.chain(results) .reject(result => result == null) .map(getUniqueValue) .every(value => _.some(resultList, compareResult => getUniqueValue(compareResult) === value)) .value() } export function addToUniqueSet(uniqueSet, ...results) { _.chain(results) .reject(result => result == null) .map(getUniqueValue) .forEach(value => { uniqueSet.add(value) }) .value() }
#!/bin/sh #$ -V #$ -cwd #$ -l mem_free=2G #$ -t 1-70 # Short jobs, your cluster may require additional resource # specifications (current header for SGE). The number of # in array == number of bigWig files being used (70 for H1). # Set bigWig directory array=(`ls ./bigWigs/*`) # e.g. for H1 cell type, run for each type of split boundary for inputfile in $( ls h*b.bins ); do # each job picks one bigWig from directory filename="${array[$SGE_TASK_ID-1]}" exprname=$( basename $filename | sed 's/wgEncode//g' ) export JOBOUTPUT_DIR=htads export JOBOUTPUT=$JOBOUTPUT_DIR/${inputfile}_$exprname [ -d $JOBOUTPUT_DIR ] || mkdir -p $JOBOUTPUT_DIR # run bigWigAverageOverBed compiled binary for your platform ./bigWigAv_linux_86 $filename $inputfile $JOBOUTPUT done
def max_submatrix_sum(matrix, k): submatrix_sum = 0 max_submatrix_sum = 0 for y in range(len(matrix) - k + 1): for x in range(len(matrix[y]) - k + 1): submatrix_sum = 0 for i in range(k): for j in range(k): submatrix_sum += matrix[y + i][x + j] max_submatrix_sum = max(max_submatrix_sum, submatrix_sum) return max_submatrix_sum
#!/bin/bash if [ -z "$HOME" ]; then echo "ERROR: 'HOME' environment variable is not set!" exit 1 fi # Source https://github.com/bash-origin/bash.origin . "$HOME/.bash.origin" function init { eval BO_SELF_BASH_SOURCE="$BO_READ_SELF_BASH_SOURCE" BO_deriveSelfDir ___TMP___ "$BO_SELF_BASH_SOURCE" local __BO_DIR__="$___TMP___" BO_sourcePrototype "$__BO_DIR__/activate.sh" function Deploy { BO_format "$VERBOSE" "HEADER" "Deploying system ..." pushd "$WORKSPACE_DIR" > /dev/null BO_log "$VERBOSE" "WORKSPACE_DIR: $WORKSPACE_DIR" BO_log "$VERBOSE" "PWD: $PWD" # TODO: Get platform names from declarations and deploy to each environment or only some # based on what we are being asked to do. if [ -z "$PLATFORM_NAME" ]; then export PLATFORM_NAME="com.heroku" fi BO_log "$VERBOSE" "PLATFORM_NAME: $PLATFORM_NAME" BO_log "$VERBOSE" "ENVIRONMENT_NAME: $ENVIRONMENT_NAME" function deployEnvironment { export ENVIRONMENT_NAME="$1" BO_log "$VERBOSE" "Deploying '$PWD' to platform '$PLATFORM_NAME' using profile '$ENVIRONMENT_NAME' ..." "$Z0_ROOT/scripts/deploy.sh" } function forEachDeployProfile { for file in $(find $1 2>/dev/null || true); do file=$(basename $file) file=${file%.proto.profile.ccjson} file=${file%.profile.ccjson} deployEnvironment "$file" done } if [ -z "$ENVIRONMENT_NAME" ]; then forEachDeployProfile "./Deployments/**.herokuapp.com.*profile.ccjson" forEachDeployProfile "./Deployments/**/*.herokuapp.com.*profile.ccjson" else deployEnvironment "$ENVIRONMENT_NAME" fi popd > /dev/null BO_format "$VERBOSE" "FOOTER" } Deploy $@ } init $@
def chess_move_evaluation(board, piece_type, player_color): """Evaluate the best move in a chess game. Parameters: board (list): a 2D list representing the current chess board piece_type (str): the type of pieces to evaluate (i.e. King, Queen, etc.) player_color (str): the color of the player (white or black) Returns: list: a list of tuples representing the best possible moves """ # Find all pieces of the specified type pieces = [] for x in range(len(board)): for y in range(len(board[x])): if board[x][y] == piece_type and board[x][y][1] == player_color: pieces.append((x, y)) # Calculate the best possible moves for each piece best_moves = [] for piece in pieces: px, py = piece best_delta_score = -float('inf') best_move = [] # Go through each potential move for dx in [-1, 0, 1]: for dy in [-1, 0, 1]: new_x, new_y = px + dx, py + dy # Skip invalid moves if not 0 <= new_x < len(board) or not 0 <= new_y < len(board): continue # Calculate delta score delta_score = 0 # Evaluate delta score for current move for p in pieces: p_x, p_y = p if p != piece: delta_score -= abs(p_x - new_x) + abs(p_y - new_y) # Check if this move is the best so far if delta_score > best_delta_score: best_delta_score = delta_score best_move = (px, py, new_x, new_y) # Add this move to the best moves best_moves.append(best_move) return best_moves
const parseHTMLSnippet = (html) => { const parser = new DOMParser(); const doc = parser.parseFromString(html, 'text/html'); const numericalValue = doc.querySelector('.ub-color_425A70').textContent.trim(); const hyperlinkText = doc.querySelector('a').textContent.trim(); const iconType = doc.querySelector('svg').getAttribute('data-icon'); return { numericalValue, hyperlinkText, iconType }; };
<gh_stars>10-100 /** * Contains format classes for color columns. */ package io.opensphere.csvcommon.format.color;
<filename>pkg/operator/config_test.go package operator import ( "testing" configv1 "github.com/openshift/api/config/v1" ) var ( imagesJSONFile = "fixtures/images.json" expectedAWSImage = "docker.io/openshift/origin-aws-machine-controllers:v4.0.0" expectedLibvirtImage = "docker.io/openshift/origin-libvirt-machine-controllers:v4.0.0" expectedOpenstackImage = "docker.io/openshift/origin-openstack-machine-controllers:v4.0.0" expectedMachineAPIOperatorImage = "docker.io/openshift/origin-machine-api-operator:v4.0.0" expectedKubeRBACProxyImage = "docker.io/openshift/origin-kube-rbac-proxy:v4.0.0" expectedBareMetalImage = "quay.io/openshift/origin-baremetal-machine-controllers:v4.0.0" expectedAzureImage = "quay.io/openshift/origin-azure-machine-controllers:v4.0.0" expectedGCPImage = "quay.io/openshift/origin-gcp-machine-controllers:v4.0.0" expectedOvirtImage = "quay.io/openshift/origin-ovirt-machine-controllers" expectedVSphereImage = "docker.io/openshift/origin-machine-api-operator:v4.0.0" expectedKubevirtImage = "quay.io/openshift/origin-kubevirt-machine-controllers" ) func TestGetProviderFromInfrastructure(t *testing.T) { tests := []struct { infra *configv1.Infrastructure expected configv1.PlatformType }{{ infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.AWSPlatformType, }, }, }, expected: configv1.AWSPlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.LibvirtPlatformType, }, }, }, expected: configv1.LibvirtPlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.OpenStackPlatformType, }, }, }, expected: configv1.OpenStackPlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.AzurePlatformType, }, }, }, expected: configv1.AzurePlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.GCPPlatformType, }, }, }, expected: configv1.GCPPlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.BareMetalPlatformType, }, }, }, expected: configv1.BareMetalPlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: kubemarkPlatform, }, }, }, expected: kubemarkPlatform, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.VSpherePlatformType, }, }, }, expected: configv1.VSpherePlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.NonePlatformType, }, }, }, expected: configv1.NonePlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ PlatformStatus: &configv1.PlatformStatus{ Type: configv1.OvirtPlatformType, }, }, }, expected: configv1.OvirtPlatformType, }, { infra: &configv1.Infrastructure{ Status: configv1.InfrastructureStatus{ Platform: configv1.OvirtPlatformType, }, }, expected: "", }} for _, test := range tests { res, err := getProviderFromInfrastructure(test.infra) // empty expected string means we were expecting it to error if err != nil && test.expected != "" { t.Errorf("failed getProviderFromInfrastructure: %v", err) } if test.expected != res { t.Errorf("failed getProviderFromInfrastructure. Expected: %q, got: %q", test.expected, res) } } } func TestGetImagesFromJSONFile(t *testing.T) { img, err := getImagesFromJSONFile(imagesJSONFile) if err != nil { t.Errorf("failed getImagesFromJSONFile") } if img.ClusterAPIControllerAWS != expectedAWSImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedAWSImage, img.ClusterAPIControllerAWS) } if img.ClusterAPIControllerLibvirt != expectedLibvirtImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedLibvirtImage, img.ClusterAPIControllerLibvirt) } if img.ClusterAPIControllerOpenStack != expectedOpenstackImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedOpenstackImage, img.ClusterAPIControllerOpenStack) } if img.ClusterAPIControllerBareMetal != expectedBareMetalImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedBareMetalImage, img.ClusterAPIControllerBareMetal) } if img.ClusterAPIControllerAzure != expectedAzureImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedAzureImage, img.ClusterAPIControllerAzure) } if img.ClusterAPIControllerGCP != expectedGCPImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedGCPImage, img.ClusterAPIControllerGCP) } if img.ClusterAPIControllerOvirt != expectedOvirtImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedOvirtImage, img.ClusterAPIControllerOvirt) } if img.ClusterAPIControllerVSphere != expectedVSphereImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedVSphereImage, img.ClusterAPIControllerVSphere) } if img.ClusterAPIControllerKubevirt != expectedKubevirtImage { t.Errorf("failed getImagesFromJSONFile. Expected: %s, got: %s", expectedKubevirtImage, img.ClusterAPIControllerKubevirt) } } func TestGetProviderControllerFromImages(t *testing.T) { tests := []struct { provider configv1.PlatformType expectedImage string }{{ provider: configv1.AWSPlatformType, expectedImage: expectedAWSImage, }, { provider: configv1.LibvirtPlatformType, expectedImage: expectedLibvirtImage, }, { provider: configv1.OpenStackPlatformType, expectedImage: expectedOpenstackImage, }, { provider: configv1.BareMetalPlatformType, expectedImage: expectedBareMetalImage, }, { provider: configv1.AzurePlatformType, expectedImage: expectedAzureImage, }, { provider: configv1.GCPPlatformType, expectedImage: expectedGCPImage, }, { provider: kubemarkPlatform, expectedImage: clusterAPIControllerKubemark, }, { provider: configv1.VSpherePlatformType, expectedImage: expectedVSphereImage, }, { provider: configv1.NonePlatformType, expectedImage: clusterAPIControllerNoOp, }, { provider: configv1.OvirtPlatformType, expectedImage: expectedOvirtImage, }, { provider: configv1.KubevirtPlatformType, expectedImage: expectedKubevirtImage, }, } img, err := getImagesFromJSONFile(imagesJSONFile) if err != nil { t.Errorf("failed getImagesFromJSONFile, %v", err) } for _, test := range tests { res, err := getProviderControllerFromImages(test.provider, *img) if err != nil { t.Errorf("failed getProviderControllerFromImages: %v", err) } if test.expectedImage != res { t.Errorf("failed getProviderControllerFromImages. Expected: %q, got: %q", test.expectedImage, res) } } } func TestGetTerminationHandlerFromImages(t *testing.T) { tests := []struct { provider configv1.PlatformType expectedImage string }{{ provider: configv1.AWSPlatformType, expectedImage: expectedAWSImage, }, { provider: configv1.LibvirtPlatformType, expectedImage: clusterAPIControllerNoOp, }, { provider: configv1.OpenStackPlatformType, expectedImage: clusterAPIControllerNoOp, }, { provider: configv1.BareMetalPlatformType, expectedImage: clusterAPIControllerNoOp, }, { provider: configv1.AzurePlatformType, expectedImage: expectedAzureImage, }, { provider: configv1.GCPPlatformType, expectedImage: expectedGCPImage, }, { provider: kubemarkPlatform, expectedImage: clusterAPIControllerNoOp, }, { provider: configv1.VSpherePlatformType, expectedImage: clusterAPIControllerNoOp, }, { provider: configv1.NonePlatformType, expectedImage: clusterAPIControllerNoOp, }, { provider: configv1.OvirtPlatformType, expectedImage: clusterAPIControllerNoOp, }, } img, err := getImagesFromJSONFile(imagesJSONFile) if err != nil { t.Errorf("failed getImagesFromJSONFile, %v", err) } for _, test := range tests { res, err := getTerminationHandlerFromImages(test.provider, *img) if err != nil { t.Errorf("failed getTerminationHandlerFromImages: %v", err) } if test.expectedImage != res { t.Errorf("failed getTerminationHandlerFromImages. Expected: %q, got: %q", test.expectedImage, res) } } } func TestGetMachineAPIOperatorFromImages(t *testing.T) { img, err := getImagesFromJSONFile(imagesJSONFile) if err != nil { t.Errorf("failed getImagesFromJSONFile, %v", err) } res, err := getMachineAPIOperatorFromImages(*img) if err != nil { t.Errorf("failed getMachineAPIOperatorFromImages : %v", err) } if res != expectedMachineAPIOperatorImage { t.Errorf("failed getMachineAPIOperatorFromImages. Expected: %s, got: %s", expectedMachineAPIOperatorImage, res) } } func TestGetKubeRBACProxyFromImages(t *testing.T) { img, err := getImagesFromJSONFile(imagesJSONFile) if err != nil { t.Errorf("failed getImagesFromJSONFile, %v", err) } res, err := getKubeRBACProxyFromImages(*img) if err != nil { t.Errorf("failed getKubeRBACProxyFromImages : %v", err) } if res != expectedKubeRBACProxyImage { t.Errorf("failed getKubeRBACProxyFromImages. Expected: %s, got: %s", expectedKubeRBACProxyImage, res) } }
<filename>src/@lekoarts/gatsby-theme-cara/elements/divider.tsx<gh_stars>1-10 import React from "react" import { css } from "theme-ui" import { ParallaxLayer } from "react-spring/renderprops-addons.cjs" type DividerProps = { speed: number offset: number children?: React.ReactNode bg?: string fill?: string clipPath?: string className?: string factor?: number } const Divider = ({ speed, offset, factor, bg, fill, clipPath, children, className }: DividerProps) => ( <ParallaxLayer css={css({ position: `absolute`, width: `full`, height: `full`, background: bg, backgroundColor: bg, "#contact-wave": { color: fill, fill: `currentColor`, }, clipPath, })} speed={speed} offset={offset} factor={factor || 1} className={className} > {children} </ParallaxLayer> ) export default Divider
#!/bin/sh # setup a fake local repository with SSH protocol fakerepo_ssh() { cd "$(mktempdir)" || exit git init -q git remote add origin git@github.com:fake/fake.git pwd } # setup a fake local repository with HTTPS protocol fakerepo_https() { cd "$(mktempdir)" || exit git init -q git remote add origin https://github.com/fake/fake.git pwd } mktempdir() { mktemp -d 2>/dev/null || mktemp -d -t 'addremote' }
<filename>src/views/Admins/Index.js import React, { Component } from 'react'; import { Badge, Card, CardBody, CardHeader, Col, Pagination, PaginationItem, PaginationLink, Row, Table } from 'reactstrap'; import { Link } from 'react-router-dom'; let $this; class IndexAdmin extends Component { constructor(props){ super(props); $this = this; } // componentDidMount(){ // this.props.getPosts($this.props.loginuser); // redux_step1 calling to actions // } // async deletePost(id){ // const returndata = await $this.props.deletePost(id); // if(returndata.data.message == "deleted"){ // $this.props.getPosts($this.props.loginuser); // }else{ // alert("something error"); console.log(returndata); // } // } tabRows(){ return $this.props.posts.map(function(post, i){ return <tr key={i}> <td>{post.title}</td> <td>{post.description}</td> <td>{(post.author)? post.author.name : ''}</td> <td> <Link to={"/editPost/"+post._id}><button>Edit</button></Link> <button onClick={() => $this.deletePost(post._id)}>Delete</button></td> </tr>; }); } render() { return ( <div className="animated fadeIn"> <Row> <Col> <Card> <CardHeader> <i className="fa fa-align-justify"></i> Danh sách tài khoản </CardHeader> <CardBody> <Table hover bordered striped responsive size="sm"> <thead> <tr> <th>Username</th> <th>Date registered</th> <th>Role</th> <th>Status</th> </tr> </thead> <tbody> <tr> <td><NAME></td> <td>2012/01/01</td> <td>Member</td> <td> <Badge color="success">Active</Badge> </td> </tr> <tr> <td><NAME></td> <td>2012/02/01</td> <td>Staff</td> <td> <Badge color="danger">Banned</Badge> </td> </tr> <tr> <td><NAME></td> <td>2012/02/01</td> <td>Admin</td> <td> <Badge color="secondary">Inactive</Badge> </td> </tr> <tr> <td><NAME></td> <td>2012/03/01</td> <td>Member</td> <td> <Badge color="warning">Pending</Badge> </td> </tr> <tr> <td><NAME></td> <td>2012/01/21</td> <td>Staff</td> <td> <Badge color="success">Active</Badge> </td> </tr> </tbody> </Table> <nav> <Pagination> <PaginationItem><PaginationLink previous tag="button">Prev</PaginationLink></PaginationItem> <PaginationItem active> <PaginationLink tag="button">1</PaginationLink> </PaginationItem> <PaginationItem><PaginationLink tag="button">2</PaginationLink></PaginationItem> <PaginationItem><PaginationLink tag="button">3</PaginationLink></PaginationItem> <PaginationItem><PaginationLink tag="button">4</PaginationLink></PaginationItem> <PaginationItem><PaginationLink next tag="button">Next</PaginationLink></PaginationItem> </Pagination> </nav> </CardBody> </Card> </Col> </Row> </div> ); } } export default IndexAdmin;
#include <stdio.h> #include <stdlib.h> long global_variable = 73; void print_stack_address(const long *addr) { long new_addr = 42; if (addr) { printf(" First called stack frame at %14p\n", addr); printf(" Second called stack frame at %14p\n", &new_addr); } else { print_stack_address(&new_addr); } } int main() { long main_var = 88; const char string[] = "Hello, world!"; long *first_addr = NULL; printf(" Main stack frame at %14p\n", &main_var); print_stack_address(first_addr); long *small = (long *)malloc(16); printf("Small malloc'd variable stored at %14p\n", small); long *large = (long *)malloc(1 << 24); printf("Large malloc'd variable stored at %14p\n", large); printf(" Called function stored at %14p\n", print_stack_address); printf(" Global variable stored at %14p\n", &global_variable); printf(" String constant stored at %14p\n", string); return 0; }
<filename>src/main/java/com/univocity/envlp/utils/ProcessLog.java package com.univocity.envlp.utils; import ch.qos.logback.classic.*; import com.github.weisj.darklaf.*; import com.github.weisj.darklaf.theme.info.*; import com.univocity.envlp.ui.*; import org.apache.commons.lang3.*; import javax.swing.*; import javax.swing.text.*; import java.awt.*; import static ch.qos.logback.classic.Level.*; import static com.github.weisj.darklaf.theme.info.ColorToneRule.*; public class ProcessLog { private static final SimpleAttributeSet ERROR_ATT_LIGHT, WARN_ATT_LIGHT, INFO_ATT_LIGHT, ANY_ATT_LIGHT; private static final SimpleAttributeSet ERROR_ATT_DARK, WARN_ATT_DARK, INFO_ATT_DARK, ANY_ATT_DARK; static { // ERROR ERROR_ATT_LIGHT = getAttributeSet(new Color(153, 0, 0), true); ERROR_ATT_DARK = getAttributeSet(new Color(225, 90, 90), true); // WARN WARN_ATT_LIGHT = getAttributeSet(new Color(153, 76, 0), false); WARN_ATT_DARK = getAttributeSet(new Color(255, 153, 0), false); // INFO INFO_ATT_LIGHT = getAttributeSet(new Color(70, 70, 70), false); INFO_ATT_DARK = getAttributeSet(new Color(200, 200, 200), false); ANY_ATT_LIGHT = getAttributeSet(null, false); ANY_ATT_DARK = getAttributeSet(null, false); } static SimpleAttributeSet getAttributeSet(Color color, boolean bold) { SimpleAttributeSet out = new SimpleAttributeSet(); out.addAttribute(StyleConstants.FontFamily, "Monospaced"); out.addAttribute(StyleConstants.CharacterConstants.Bold, bold ? Boolean.TRUE : Boolean.FALSE); out.addAttribute(StyleConstants.CharacterConstants.Italic, Boolean.FALSE); if (color != null) { out.addAttribute(StyleConstants.CharacterConstants.Foreground, new Color(255, 255, 255)); } return out; } private final JTextPane outputArea; public ProcessLog(LogPanel logPanel) { this.outputArea = logPanel.getOutputArea(); } public void append(String logMsg) { Level level = ALL; if (logMsg.indexOf(":Notice:") > 0) { level = DEBUG; } else if (logMsg.indexOf(":Info:") > 0) { level = INFO; } append(logMsg, level); } protected final void append(String formattedMsg, Level level) { if (formattedMsg == null || formattedMsg.length() == 0) { return; } String tmp = StringUtils.truncate(formattedMsg, 1024); int length = tmp.length(); if (length < formattedMsg.length()) { tmp += "...\n"; } else if (length > 0 && tmp.charAt(length - 1) != '\n') { tmp += "\n"; } String msg = tmp; SwingUtilities.invokeLater(() -> { Document doc = outputArea.getDocument(); try { int lineLimit = 1000; int toErase = 200; if (doc.getDefaultRootElement().getElementCount() > lineLimit) { int end = getLineEndOffset(doc, toErase); removeOld(doc, end); } doc.insertString(doc.getLength(), msg, getLogMessageAttributeSet(level)); } catch (BadLocationException e) { //do nothing } }); } private SimpleAttributeSet getLogMessageAttributeSet(Level level) { ColorToneRule tone = LafManager.getTheme().getColorToneRule(); switch (level.levelInt) { case ERROR_INT: return tone == DARK ? ERROR_ATT_DARK : ERROR_ATT_LIGHT; case WARN_INT: return tone == DARK ? WARN_ATT_DARK : WARN_ATT_LIGHT; case INFO_INT: return tone == DARK ? INFO_ATT_DARK : INFO_ATT_LIGHT; case DEBUG_INT: case TRACE_INT: default: return tone == DARK ? ANY_ATT_DARK : ANY_ATT_LIGHT; } } private int getLineCount(Document doc) { return doc.getDefaultRootElement().getElementCount(); } private int getLineEndOffset(Document doc, int line) throws BadLocationException { int lineCount = getLineCount(doc); if (line < 0) { throw new BadLocationException("Negative line", -1); } else if (line >= lineCount) { throw new BadLocationException("No such line", doc.getLength() + 1); } else { Element map = doc.getDefaultRootElement(); Element lineElem = map.getElement(line); int endOffset = lineElem.getEndOffset(); // hide the implicit break at the end of the document return ((line == lineCount - 1) ? (endOffset - 1) : endOffset); } } private void removeOld(Document doc, int end) throws IllegalArgumentException { try { if (doc instanceof AbstractDocument) { ((AbstractDocument) doc).replace(0, end, null, null); } else { doc.remove(0, end); doc.insertString(0, null, null); } } catch (BadLocationException e) { throw new IllegalArgumentException(e.getMessage()); } } }
<gh_stars>100-1000 package org.openwebflow.util; import org.activiti.engine.ProcessEngine; import org.activiti.engine.impl.RepositoryServiceImpl; import org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior; import org.activiti.engine.impl.el.FixedValue; import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity; import org.activiti.engine.impl.pvm.process.ActivityImpl; import org.activiti.engine.impl.task.TaskDefinition; import org.apache.commons.lang.reflect.FieldUtils; import org.apache.log4j.Logger; /** * 流程定义相关操作的封装 * * @author <EMAIL> * */ public abstract class ProcessDefinitionUtils { public static ActivityImpl getActivity(ProcessEngine processEngine, String processDefId, String activityId) { ProcessDefinitionEntity pde = getProcessDefinition(processEngine, processDefId); return (ActivityImpl) pde.findActivity(activityId); } public static ProcessDefinitionEntity getProcessDefinition(ProcessEngine processEngine, String processDefId) { return (ProcessDefinitionEntity) ((RepositoryServiceImpl) processEngine.getRepositoryService()) .getDeployedProcessDefinition(processDefId); } public static void grantPermission(ActivityImpl activity, String assigneeExpression, String candidateGroupIdExpressions, String candidateUserIdExpressions) throws Exception { TaskDefinition taskDefinition = ((UserTaskActivityBehavior) activity.getActivityBehavior()).getTaskDefinition(); taskDefinition.setAssigneeExpression(assigneeExpression == null ? null : new FixedValue(assigneeExpression)); FieldUtils.writeField(taskDefinition, "candidateUserIdExpressions", ExpressionUtils.stringToExpressionSet(candidateUserIdExpressions), true); FieldUtils.writeField(taskDefinition, "candidateGroupIdExpressions", ExpressionUtils.stringToExpressionSet(candidateGroupIdExpressions), true); Logger.getLogger(ProcessDefinitionUtils.class).info( String.format("granting previledges for [%s, %s, %s] on [%s, %s]", assigneeExpression, candidateGroupIdExpressions, candidateUserIdExpressions, activity.getProcessDefinition().getKey(), activity.getProperty("name"))); } }
<gh_stars>0 package org.aquacoope.mo.exception; public class NetworkNotFoundException extends RuntimeException { public NetworkNotFoundException(String id) { super("Could not find network " + id); } }
import { Component, ElementRef, OnInit, Output, EventEmitter, AfterViewInit, OnDestroy, } from '@angular/core'; import { Router } from '@angular/router'; import { LoggerService, LoadingService, ApiService, AuthService, PopupService, ErrorService, } from "./../../../services"; import { Course, Question, ErrorMessage, PopupBase, SelectValue, } from "./../../../models"; @Component({ selector: 'courses-form', templateUrl: './form.component.html', styleUrls: ['./form.component.scss'], providers: [ ApiService, AuthService, LoggerService, PopupService, LoadingService, ], inputs: ['course', 'popup', 'showQuestion'], }) export class CoursesFormComponent implements OnInit, OnDestroy { public course: Course; public courseTypes: SelectValue[] = [{ value: 'training', name: "トレーニング" }, { value: 'test', name: 'テスト' }]; public questionAttributeTypes: SelectValue[] = [{ value: 'select', name: '選択問題' }, { value: 'input', name: '穴埋め問題' }, { value: 'lecture', name: '講義資料' }]; public popup: PopupBase; public random = Math.floor( Math.random() * 10000000 ); public selectedIndex: number = -1; public showQuestion: boolean = true; public popup_text: string; public popup_header: string; public errors: ErrorMessage[]; private _tab: any; private questionLoading: boolean = false; //@Output() startLoading = new EventEmitter(); //@Output() endLoading = new EventEmitter(); questionStartLoading(){ this.questionLoading = true; } questionEndLoading(){ this.questionLoading = false; } constructor( private el: ElementRef, private _logger: LoggerService, private _loading: LoadingService, private _api: ApiService, private _router: Router, private _error: ErrorService, private _popup: PopupService ) { this._logger.debug(" ***** Coustructor courses form component *****"); } courseConfig(){ this.selectedIndex = -1; this._tab.tabs('select_tab', 'tab1'); } tabQuestions(){ this._tab.tabs('select_tab', 'tab2'); if(this.selectedIndex == -1){ this.selectedIndex = 1; } } setCourse(course: Course) { this.course = course; } createQuestion() { this._logger.debug("question INDEX = " + this.course.questions.length); this.questionStartLoading(); this.course.questions.push(new Question("", this.course, this.course.questions.length+1)); } selectQuestionIndex(i: number){ this.selectedIndex = i; } selectQuestion(e, i) { this._tab.tabs('select_tab', 'tab2'); this.selectedIndex = i; } ngOnDestroy(){ } ngOnInit() { this._logger.debug(" ***** ngOnInit courses form component *****"); //this.startLoading.emit('event'); // this.startValidation(); // TODO: 発火タイミングをもっといい感じにできる気がする。 // TODO: と言うか、このタイミングだと発火しそこねる気がする。 jQuery(this.el.nativeElement).find('.collapsible') .each(function(i) { jQuery(this).collapsible({accordion: false}); }); this._tab = jQuery(this.el.nativeElement).find('ul.tabs').tabs(); this._tab.tabs('select_tab', 'tab1'); // エディタの起動を早くするために、最初に一度読み込んでおく // 多分..有効だと思う //tinymce.init({}); } ngAfterViewInit(){ this._logger.debug(" **** course form ng after view init "); //this.endLoading.emit('event'); } postCreateCourse(){ this._logger.debug("***********"); this._loading.setCurtain(); this._api.postCreateCourse(this.course).subscribe( data => { var body = data.json(); this._logger.debug(data); this.course = new Course(); this.course.assignParams(body.data); //this._router.navigateByUrl('courses/' + data.data.course_id); }, err => { this._error.errorInit(err); /** * Popup 作成処理 * popup.id は親Componentで定義しといてもらう * @type {string} */ this.popup.headerText = "コース作成エラー"; this.popup.errorMessages = this._error.errors(); // //this.popup.errorMessages.forEach( (errorMessage: ErrorMessage) => { // errorMessage.paramsArray().forEach( (param: string) =>{ // console.log(param); // console.log(this._error.replaceParam(param)) // }) //}); this._popup.displayPopup(this.popup); this._loading.endLoading(); }, () => { setTimeout( ()=>{ jQuery(this.el.nativeElement).find('ul.tabs').tabs('select_tab', 'tab2'); },0 ); this._loading.endLoading(); this._logger.debug('signup success') } ); } postUpdateCourse(){ this._logger.debug("****** postCreateCourse *****"); this._logger.debug(this.course); this._loading.setCurtain(); this._api.postEditCourse(this.course).subscribe( data => { var body = data.json(); this._logger.debug(data); this._router.navigateByUrl('courses/' + body.data.course_id + '/detail'); }, err => { this._popup.displayError(err, "コース更新エラー"); this._loading.endLoading(); }, () => { this._loading.endLoading(); this._logger.debug('signup success'); } ); } startValidation() { var formId = "#course_form"; jQuery(formId).data('validator', null); jQuery(formId).unbind('validate'); jQuery(formId).validate({ rules: { name: { required: true }, course_type: { required: true } }, messages: { name: { required: "コース名を入力して下さい", }, course_type: { required: "コース形式を選択して下さい" } }, errorElement : 'div', errorPlacement: function(error, element) { var placement = jQuery(element).data('error'); if (placement) { jQuery(placement).append(error) } else { error.insertAfter(element); } }, submitHandler: this.submitFunction.bind(this) }); } submitFunction() { console.log(this.course); if(this.course.id) { this.postUpdateCourse(); } else { this.postCreateCourse(); } } }
<reponame>Sara-Alkhamri/data-structures-and-algos //Big O Rule Book //Rule 1: Worst Case. //We always care about what is the worst case scenario becuase we can't assume thongs will go well i.e when running a for loop, we can't assume //the item we are looking for will be the first in the array. //So if we can't be certain what the input will be, we will assume the big O is O(n) or linear time. //Rule 2: Remove Constants. //Big-O notation doesn't care about constants because big-O notation only describes the long-term growth rate of functions, rather than their absolute magnitudes. Multiplying a function by a constant only influences its growth rate by a constant amount, so linear functions still grow linearly, //logarithmic functions still grow logarithmically, exponential functions still grow exponentially, etc. //Since these categories aren't affected by constants, it doesn't matter that we drop the constants. //Rule 3: Different terms for inputs. //Below fucntion loops twice over the boxes array. //The Big O of this function will be O(2n) but because we know to drop the constants, it will be O(n) function compressBoxesTwice(boxes, boxes2) { boxes.forEach(function(boxes) { //loops over the first input console.log(boxes) }) boxes2.forEach(function(boxes) { //loops over the second input console.log(boxes) }) } // the big o for this function after adding a second param, will be O(boxes + boxes2) //Rule 4: Drp non dominants function printAllNumbersThenAllPairSums(numbers) { console.log('these are the numbers: '); numbers.forEach(function(number) { console.log(number); }) console.log('and these are their sums: '); numbers.forEach(function(firstNumber) { numbers.forEach(function(secondNumber) { console.log(firstNumber + secondNumber); }) }) } printAllNumbersThenAllPairSums([1, 2, 3, 4, 5]) //the big o here will be O(n^2)
<filename>src/main/java/org/xaplus/engine/XAPlusRestController.java package org.xaplus.engine; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.xaplus.engine.events.xaplus.*; /** * @since 1.0.0 * @author <NAME> (<EMAIL>) */ @RestController class XAPlusRestController { static private final Logger logger = LoggerFactory.getLogger(XAPlusRestController.class); private final XAPlusDispatcher dispatcher; XAPlusRestController(XAPlus xaPlus) { this.dispatcher = xaPlus.dispatcher; } @RequestMapping("xaplus/ready") boolean ready(@RequestParam("xid") String xidString) { try { XAPlusXid xid = XAPlusXid.fromString(xidString); if (logger.isDebugEnabled()) { logger.debug("Got ready status from subordinate server {}, xid={}", xid.getBqual().getServerId(), xid); } dispatcher.dispatch(new XAPlusRemoteSubordinateReadyEvent(xid)); return true; } catch (IllegalArgumentException iae) { return false; } catch (InterruptedException ie) { return false; } } @RequestMapping("xaplus/commit") boolean commit(@RequestParam("xid") String xidString) { try { XAPlusXid xid = XAPlusXid.fromString(xidString); if (logger.isDebugEnabled()) { logger.debug("Got commit request from superior server {}, xid={}", xid.getGtrid().getServerId(), xid); } dispatcher.dispatch(new XAPlusRemoteSuperiorOrderToCommitEvent(xid)); return true; } catch (IllegalArgumentException iae) { return false; } catch (InterruptedException ie) { return false; } } @RequestMapping("xaplus/rollback") boolean rollback(@RequestParam("xid") String xidString) { try { XAPlusXid xid = XAPlusXid.fromString(xidString); if (logger.isDebugEnabled()) { logger.debug("Got rollback request from superior server {}, xid={}", xid.getGtrid().getServerId(), xid); } dispatcher.dispatch(new XAPlusRemoteSuperiorOrderToRollbackEvent(xid)); return true; } catch (IllegalArgumentException iae) { return false; } catch (InterruptedException ie) { return false; } } @RequestMapping("xaplus/failed") boolean failed(@RequestParam("xid") String xidString) { try { XAPlusXid xid = XAPlusXid.fromString(xidString); if (logger.isDebugEnabled()) { logger.debug("Got failed status from subordinate server {}, xid={}", xid.getBqual().getServerId(), xid); } dispatcher.dispatch(new XAPlusRemoteSubordinateFailedEvent(xid)); return true; } catch (IllegalArgumentException iae) { return false; } catch (InterruptedException ie) { return false; } } @RequestMapping("xaplus/retry") boolean retry(@RequestParam("xid") String xidString) { try { XAPlusXid xid = XAPlusXid.fromString(xidString); if (logger.isDebugEnabled()) { logger.debug("Got retry request from subordinate server {}, xid={}", xid.getBqual().getServerId(), xid); } dispatcher.dispatch(new XAPlusRemoteSubordinateRetryRequestEvent(xid)); return true; } catch (InterruptedException ie) { return false; } } }
//NUMERO DE IDENTIFICACION ALUMNO const frminscripcion=document.querySelector('#frminscripcion') const numid=document.querySelector('#camponumid .feedback') const numidentificacion=/^[0-9]{5,15}$/ frminscripcion.numid.addEventListener('input', e =>{ e.preventDefault() if(numidentificacion.test(e.target.value)){ frminscripcion.numid.setAttribute("class","success") numid.textContent="" numid.style.setProperty("visibility","hidden") numid.style.setProperty("opacity","0") } else{ frminscripcion.numid.setAttribute("class","error") numid.textContent="El valor no es numérico y/o no tiene entre 5 y 15 caracteres" numid.style.setProperty("visibility","visible") numid.style.setProperty("opacity","1") } }) //NOMBRES ALUMNO const nombreal=document.querySelector('#camponombrealumno .feedback') const nombrealumno=/^[A-záéíóúáéíóúÁÉÍÓÚñÑ\s]{5,25}$/ frminscripcion.nombrealumno.addEventListener('input', e =>{ e.preventDefault() if(nombrealumno.test(e.target.value)){ frminscripcion.nombrealumno.setAttribute("class","success") nombreal.textContent="" nombreal.style.setProperty("visibility","hidden") nombreal.style.setProperty("opacity","0") } else{ frminscripcion.nombrealumno.setAttribute("class","error") nombreal.textContent="Entre 5 y 25 caracteres, no números ni caracteres especiales" nombreal.style.setProperty("visibility","visible") nombreal.style.setProperty("opacity","1") } }) //APELLIDOS ALUMNO const apellidoal=document.querySelector('#campoapellidoalumno .feedback') const apellidoalumno=/^[A-záéíóúáéíóúÁÉÍÓÚñÑ\s]{5,25}$/ frminscripcion.apellidoalumno.addEventListener('input', e =>{ e.preventDefault() if(apellidoalumno.test(e.target.value)){ frminscripcion.apellidoalumno.setAttribute("class","success") apellidoal.textContent="" apellidoal.style.setProperty("visibility","hidden") apellidoal.style.setProperty("opacity","0") } else{ frminscripcion.apellidoalumno.setAttribute("class","error") apellidoal.textContent="Entre 5 y 25 caracteres, no números ni caracteres especiales" apellidoal.style.setProperty("visibility","visible") apellidoal.style.setProperty("opacity","1") } }) //CAMPO TELEFONO ALUMNO: const telefonoalumno=document.querySelector('#campotelefonoalumno .feedback') const telalumno=/^[0-9]{5,15}$/ frminscripcion.telefonoalumno.addEventListener('input', e =>{ e.preventDefault() if(telalumno.test(e.target.value)){ frminscripcion.telefonoalumno.setAttribute("class","success") telefonoalumno.textContent="" telefonoalumno.style.setProperty("visibility","hidden") telefonoalumno.style.setProperty("opacity","0") } else{ frminscripcion.telefonoalumno.setAttribute("class","error") telefonoalumno.textContent="El valor no es numérico y/o no tiene entre 5 y 15 caracteres" telefonoalumno.style.setProperty("visibility","visible") telefonoalumno.style.setProperty("opacity","1") } }) //CAMPO DIRECCION ALUMNO: const direccionalumno=document.querySelector('#campodireccionalumno .feedback') const direccional=/^[A-záéíóúáéíóúÁÉÍÓÚñÑ#-+\0-9]{5,100}$/ frminscripcion.direccionalumno.addEventListener('input', e =>{ e.preventDefault() if(direccional.test(e.target.value)){ frminscripcion.direccionalumno.setAttribute("class","success") direccionalumno.textContent="" direccionalumno.style.setProperty("visibility","hidden") direccionalumno.style.setProperty("opacity","0") } else{ frminscripcion.direccionalumno.setAttribute("class","error") direccionalumno.textContent="Máximo 100 caracteres" direccionalumno.style.setProperty("visibility","visible") direccionalumno.style.setProperty("opacity","1") } }) //CAMPO CORREO ELECTRONICO //QUERY SELECTOR DA ACCESO EN ESE CASO A TODOS LOS INPUT DEL FORM const correoalum=document.querySelector('#campocorreoalumno .feedback') const correoal=/^[A-Za-z0-9_.-]+@\w+\.[a-zA-z]+\.?[a-zA-z]+/ frminscripcion.correoalumno.addEventListener('input', e =>{ e.preventDefault() if(correoal.test(e.target.value)){ frminscripcion.correoalumno.setAttribute("class","success") correoalum.textContent="" correoalum.style.setProperty("visibility","hidden") correoalum.style.setProperty("opacity","0") } else{ frminscripcion.correoalumno.setAttribute("class","error") correoalum.textContent="Valor no valido para correo electrónico" correoalum.style.setProperty("visibility","visible") correoalum.style.setProperty("opacity","1") } }) //SOLICITUD frminscripcion.addEventListener("submit", e=>{ e.preventDefault() let numid=document.getElementById("numid").value let apellidoalumno=document.getElementById("apellidoalumno").value let nombrealumno=document.getElementById("nombrealumno").value let telefonoalumno=document.getElementById("telefonoalumno").value let direccionalumno=document.getElementById("direccionalumno").value let correoalumno=document.getElementById("correoalumno").value if(numid==0){ alert("Diligencie el número de identificación") document.frminscripcion.numid.focus() } else if(apellidoalumno==0){ alert("Diligencie sus apellidos completos") document.frminscripcion.apellidoalumno.focus() } else if(nombrealumno==0){ alert("Diligencie su nombre completo") document.frminscripcion.curso.focus() } else if(telefonoalumno==0){ alert("El teléfono debe ser diligenciado") document.frminscripcion.telefonoalumno.focus() } else if(direccionalumno==0){ alert("Especifique su dirección") document.frminscripcion.direccionalumno.focus() } else if (correoalumno==0){ alert("El correo electronico debe ser diligenciado") document.frminscripcion.correoalumno.focus() } else{ frminscripcion.submit() alert("Desea enviar el formulario de inscripcion a educaccion.com?.") window.open("pago.html") } })
#! /usr/bin/env bash # # ---------------------------------------------------------------------------- # Install WINE from the repository # ---------------------------------------------------------------------------- # INCLUDES="core-install.bash" if [[ -f "${INCLUDES}" ]]; then source "${INCLUDES}" else echo -n "$( basename "${0}" ): error: " echo "Could not source the '${INCLUDES}' file ! " exit fi GetScriptName "${0}" USAGE=" This script installs the default version of Wine from the distro repositories. The PPA version of this script will install a more up-to-date version. Note that the Pipelight script will install Wine as a dependency; this script will conflict with that, so install either Pipelight or Wine, but not both. Wine is a free and open source software application that allows applications designed for Microsoft Windows to run on Unix-like operating systems. Wine also provides a software library, known as Winelib, against which developers can compile Windows applications to help port them to Unix-like systems. Wine is a compatibility layer. It duplicates functions of Windows by providing alternative implementations of the DLLs that Windows programs call, as well as a process to substitute for the Windows NT kernel. This method of duplication differs from other methods that might also be considered emulation, where Windows programs run in a virtual machine. Wine is predominantly written using 'black-box testing' reverse-engineering to avoid copyright issues. In Wine, the Windows app's compiled x86 code runs at full native speed on the computer's x86 processor, just as it does when running under Windows. Windows API calls and services are not emulated either, but rather substituted with Linux equivalents that are compiled for x86 and run at full, native speed. In a 2007 survey by desktoplinux.com of 38,500 Linux desktop users, 31.5% of respondents reported using Wine to run Windows applications. This plurality was larger than all x86 virtualization programs combined, as well as larger than the 27.9% who reported not running Windows applications. http://www.winehq.org/ " POST_INSTALL=" To configure Wine, search for the Wine configuration tool, 'configure wine' using the Dash. " SET_NAME="Wine (repo)" PACKAGE_SET="wine " [[ -z "${1}" || "${1}" == "-i" ]] && PerformAppInstallation "$@" INST_VERS=$( wine --version 2>/dev/null | \ egrep -o '[[:digit:]]+[.][[:digit:]]' ) if (( $? == 0 )); then Get_YesNo_Defaulted -y \ "Wine version ${INST_VERS} is already installed. Co-installing multiple versions of wine is not recommended. Continue?" fi (( $? > 0 )) && exit : <<__COMMENT Get_YesNo_Defaulted -y \ "Be aware that 'pipelight' installs its own customized version of 'wine', and that co-installing multiple versions of wine is not recommended. Do you intend to install 'pipelight'?" (( $? == 0 )) && exit __COMMENT echo " Note that this installation requires user input mid-way through to confirm an End User License Agreement for installing font packages. (Use the <tab> key to jump between response fields, and <Enter> to select a response.) " sleep 3 PerformAppInstallation "$@"
<reponame>matchup-ir/whooshy<gh_stars>100-1000 from .bases import _StandardStemmer from whoosh.compat import u class PortugueseStemmer(_StandardStemmer): """ The Portuguese Snowball stemmer. :cvar __vowels: The Portuguese vowels. :type __vowels: unicode :cvar __step1_suffixes: Suffixes to be deleted in step 1 of the algorithm. :type __step1_suffixes: tuple :cvar __step2_suffixes: Suffixes to be deleted in step 2 of the algorithm. :type __step2_suffixes: tuple :cvar __step4_suffixes: Suffixes to be deleted in step 4 of the algorithm. :type __step4_suffixes: tuple :note: A detailed description of the Portuguese stemming algorithm can be found under http://snowball.tartarus.org/algorithms/portuguese/stemmer.html """ __vowels = u("aeiou\xE1\xE9\xED\xF3\xFA\xE2\xEA\xF4") __step1_suffixes = ('amentos', 'imentos', 'uciones', 'amento', 'imento', 'adoras', 'adores', u('a\xE7o~es'), u('log\xEDas'), u('\xEAncias'), 'amente', 'idades', 'ismos', 'istas', 'adora', u('a\xE7a~o'), 'antes', u('\xE2ncia'), u('log\xEDa'), u('uci\xF3n'), u('\xEAncia'), 'mente', 'idade', 'ezas', 'icos', 'icas', 'ismo', u('\xE1vel'), u('\xEDvel'), 'ista', 'osos', 'osas', 'ador', 'ante', 'ivas', 'ivos', 'iras', 'eza', 'ico', 'ica', 'oso', 'osa', 'iva', 'ivo', 'ira') __step2_suffixes = (u('ar\xEDamos'), u('er\xEDamos'), u('ir\xEDamos'), u('\xE1ssemos'), u('\xEAssemos'), u('\xEDssemos'), u('ar\xEDeis'), u('er\xEDeis'), u('ir\xEDeis'), u('\xE1sseis'), u('\xE9sseis'), u('\xEDsseis'), u('\xE1ramos'), u('\xE9ramos'), u('\xEDramos'), u('\xE1vamos'), 'aremos', 'eremos', 'iremos', 'ariam', 'eriam', 'iriam', 'assem', 'essem', 'issem', 'ara~o', 'era~o', 'ira~o', 'arias', 'erias', 'irias', 'ardes', 'erdes', 'irdes', 'asses', 'esses', 'isses', 'astes', 'estes', 'istes', u('\xE1reis'), 'areis', u('\xE9reis'), 'ereis', u('\xEDreis'), 'ireis', u('\xE1veis'), u('\xEDamos'), 'armos', 'ermos', 'irmos', 'aria', 'eria', 'iria', 'asse', 'esse', 'isse', 'aste', 'este', 'iste', 'arei', 'erei', 'irei', 'aram', 'eram', 'iram', 'avam', 'arem', 'erem', 'irem', 'ando', 'endo', 'indo', 'adas', 'idas', u('ar\xE1s'), 'aras', u('er\xE1s'), 'eras', u('ir\xE1s'), 'avas', 'ares', 'eres', 'ires', u('\xEDeis'), 'ados', 'idos', u('\xE1mos'), 'amos', 'emos', 'imos', 'iras', 'ada', 'ida', u('ar\xE1'), 'ara', u('er\xE1'), 'era', u('ir\xE1'), 'ava', 'iam', 'ado', 'ido', 'ias', 'ais', 'eis', 'ira', 'ia', 'ei', 'am', 'em', 'ar', 'er', 'ir', 'as', 'es', 'is', 'eu', 'iu', 'ou') __step4_suffixes = ("os", "a", "i", "o", u("\xE1"), u("\xED"), u("\xF3")) def stem(self, word): """ Stem a Portuguese word and return the stemmed form. :param word: The word that is stemmed. :type word: str or unicode :return: The stemmed form. :rtype: unicode """ word = word.lower() step1_success = False step2_success = False word = (word.replace(u("\xE3"), "a~") .replace(u("\xF5"), "o~")) r1, r2 = self._r1r2_standard(word, self.__vowels) rv = self._rv_standard(word, self.__vowels) # STEP 1: Standard suffix removal for suffix in self.__step1_suffixes: if word.endswith(suffix): if suffix == "amente" and r1.endswith(suffix): step1_success = True word = word[:-6] r2 = r2[:-6] rv = rv[:-6] if r2.endswith("iv"): word = word[:-2] r2 = r2[:-2] rv = rv[:-2] if r2.endswith("at"): word = word[:-2] rv = rv[:-2] elif r2.endswith(("os", "ic", "ad")): word = word[:-2] rv = rv[:-2] elif (suffix in ("ira", "iras") and rv.endswith(suffix) and word[-len(suffix) - 1:-len(suffix)] == "e"): step1_success = True word = "".join((word[:-len(suffix)], "ir")) rv = "".join((rv[:-len(suffix)], "ir")) elif r2.endswith(suffix): step1_success = True if suffix in (u("log\xEDa"), u("log\xEDas")): word = word[:-2] rv = rv[:-2] elif suffix in (u("uci\xF3n"), "uciones"): word = "".join((word[:-len(suffix)], "u")) rv = "".join((rv[:-len(suffix)], "u")) elif suffix in (u("\xEAncia"), u("\xEAncias")): word = "".join((word[:-len(suffix)], "ente")) rv = "".join((rv[:-len(suffix)], "ente")) elif suffix == "mente": word = word[:-5] r2 = r2[:-5] rv = rv[:-5] if r2.endswith(("ante", "avel", u("\xEDvel"))): word = word[:-4] rv = rv[:-4] elif suffix in ("idade", "idades"): word = word[:-len(suffix)] r2 = r2[:-len(suffix)] rv = rv[:-len(suffix)] if r2.endswith(("ic", "iv")): word = word[:-2] rv = rv[:-2] elif r2.endswith("abil"): word = word[:-4] rv = rv[:-4] elif suffix in ("iva", "ivo", "ivas", "ivos"): word = word[:-len(suffix)] r2 = r2[:-len(suffix)] rv = rv[:-len(suffix)] if r2.endswith("at"): word = word[:-2] rv = rv[:-2] else: word = word[:-len(suffix)] rv = rv[:-len(suffix)] break # STEP 2: Verb suffixes if not step1_success: for suffix in self.__step2_suffixes: if rv.endswith(suffix): step2_success = True word = word[:-len(suffix)] rv = rv[:-len(suffix)] break # STEP 3 if step1_success or step2_success: if rv.endswith("i") and word[-2] == "c": word = word[:-1] rv = rv[:-1] ### STEP 4: Residual suffix if not step1_success and not step2_success: for suffix in self.__step4_suffixes: if rv.endswith(suffix): word = word[:-len(suffix)] rv = rv[:-len(suffix)] break # STEP 5 if rv.endswith(("e", u("\xE9"), u("\xEA"))): word = word[:-1] rv = rv[:-1] if ((word.endswith("gu") and rv.endswith("u")) or (word.endswith("ci") and rv.endswith("i"))): word = word[:-1] elif word.endswith(u("\xE7")): word = "".join((word[:-1], "c")) word = word.replace("a~", u("\xE3")).replace("o~", u("\xF5")) return word
#!/bin/bash USB=/dev/cu.wchusbserial1420 ./esptool.py --port $USB write_flash -fm dio -fs 32m 0x00000 ./nodemcu_integer_flash.bin
#!/bin/bash set -eux sudo cp node_modules/chromedriver/lib/chromedriver/chromedriver /usr/local/bin/chromedriver pip install -e . export DB=${DB:-sqlite} if [ ${DB} = sqlite ]; then rm ~/.birdseye_test.db || true export BIRDSEYE_DB=sqlite:///$HOME/.birdseye_test.db elif [ ${DB} = postgres ]; then psql -c 'DROP DATABASE IF EXISTS birdseye_test;' -U postgres psql -c 'CREATE DATABASE birdseye_test;' -U postgres export BIRDSEYE_DB="postgresql://postgres:@localhost/birdseye_test" elif [ ${DB} = mysql ]; then mysql -e 'DROP DATABASE IF EXISTS birdseye_test;' mysql -e 'CREATE DATABASE birdseye_test;' export BIRDSEYE_DB="mysql+mysqlconnector://root:@localhost/birdseye_test" else echo "Unknown database $DB" exit 1 fi export BIRDSEYE_SERVER_RUNNING=true gunicorn -b 127.0.0.1:7777 birdseye.server:app & set +e pytest -vv result=$? kill $(ps aux | grep birdseye.server:app | grep -v grep | awk '{print $2}') exit ${result}
package fr.unistra.iutrs.a31.observer; import java.util.ArrayList; import java.util.List; import static java.util.Objects.requireNonNull; public abstract class Subject { private final List<Observer> observers; public Subject() { observers = new ArrayList<>(); } public void register(Observer o) { observers.add(requireNonNull(o)); } public void unregister(Observer o) { observers.remove(o); } protected void notifyObservers() { observers.forEach(Observer::update); } protected final List<Observer> getObservers() { return observers; } protected final void clearObservers() { observers.clear(); } }
package morpheus_test import ( "testing" "github.com/gomorpheus/morpheus-go-sdk" ) func TestPriceSet(t *testing.T) { client := getTestClient(t) req := &morpheus.Request{} resp, err := client.ListPriceSets(req) assertResponse(t, resp, err) } func TestGetPriceSet(t *testing.T) { client := getTestClient(t) req := &morpheus.Request{} resp, err := client.ListPriceSets(req) assertResponse(t, resp, err) // parse JSON and fetch the first one by ID result := resp.Result.(*morpheus.ListPriceSetsResult) recordCount := result.Meta.Total t.Logf("Found %d Price Sets.", recordCount) if recordCount != 0 { // Get by ID record := (*result.PriceSets)[0] resp, err = client.GetPriceSet(record.ID, &morpheus.Request{}) assertResponse(t, resp, err) } } func TestPriceSetsCRUD(t *testing.T) { client := getTestClient(t) //create req := &morpheus.Request{ Body: map[string]interface{}{ "priceSet": map[string]interface{}{ "name": "sdk-test", "code": "sdk-test", "account": map[string]interface{}{ "id": 1, }, "priceUnit": "month", "type": "fixed", }, }, } resp, err := client.CreatePriceSet(req) result := resp.Result.(*morpheus.CreatePriceSetResult) assertResponse(t, resp, err) t.Log("Price Create Complete") assertNotNil(t, result) assertEqual(t, result.Success, true) getRequest := &morpheus.Request{} getResponse, err := client.GetPriceSet(result.ID, getRequest) if err != nil { t.Error(err) } getResult := getResponse.Result.(*morpheus.GetPriceSetResult) assertEqual(t, getResult.PriceSet.Type, "fixed") t.Log("Initial Get Complete") // update updateReq := &morpheus.Request{ Body: map[string]interface{}{ "priceSet": map[string]interface{}{ "restartUsage": false, }, }, } updateResp, updateErr := client.UpdatePriceSet(result.ID, updateReq) updateResult := updateResp.Result.(*morpheus.UpdatePriceSetResult) getRequest = &morpheus.Request{} getResponse, err = client.GetPriceSet(result.ID, getRequest) if err != nil { t.Error(err) } getResult = getResponse.Result.(*morpheus.GetPriceSetResult) assertEqual(t, getResult.PriceSet.RestartUsage, false) assertResponse(t, updateResp, updateErr) assertNotNil(t, updateResult) assertEqual(t, updateResult.Success, true) t.Log("Price Update Complete") // delete deleteReq := &morpheus.Request{} deleteResp, deleteErr := client.DeletePriceSet(result.ID, deleteReq) deleteResult := deleteResp.Result.(*morpheus.DeletePriceSetResult) assertResponse(t, deleteResp, deleteErr) assertNotNil(t, deleteResult) assertEqual(t, deleteResult.Success, true) }
<gh_stars>0 package com.simple.app.async.todo.service; import com.github.pgasync.Db; import com.github.pgasync.Row; import com.simple.app.async.todo.domain.Todo; import rx.Observable; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; import java.util.function.Function; import static java.util.Arrays.asList; public class TodoService { private static final Function<Row, Todo> ROW_MAPPER = row -> new Todo( row.getLong("id"), row.getString("owner"), row.getString("title"), row.getString("description"), row.getTimestamp("created_on").toLocalDateTime() ); private static final Function<Todo, List<Object>> ROW_UNMAPPER = todo -> asList( todo.getOwner(), todo.getTitle(), todo.getDescription(), Timestamp.valueOf(todo.getCreatedOn()), todo.getId() ); private final Db db; public TodoService(Db db) { this.db = db; } public Observable<Todo> findAll() { return db.queryRows("SELECT * FROM todo LIMIT 10").map(ROW_MAPPER::apply); } public Observable<Todo> findOne(Long id) { return db.queryRows("SELECT * FROM todo where id = $1", id).map(ROW_MAPPER::apply); } public Observable<Todo> save(Todo todo) { Object[] params = ROW_UNMAPPER.apply(todo).toArray(); final String sql = todo.getId() == null ? "INSERT INTO todo (owner, title, description, created_on) VALUES ($1, $2, $3, $4) RETURNING *" : "UPDATE todo SET (owner, title, description, created_on) = ($1,$2,$3,$4) WHERE id = $5 RETURNING *"; params = todo.getId() == null ? Arrays.copyOfRange(params, 0, 4) : params; return db.queryRows(sql, params).map(ROW_MAPPER::apply); } public Observable<Boolean> remove(Long id) { return db.querySet("DELETE FROM todo WHERE id = $1", id).map(set -> set.updatedRows() > 0); } }
from .CFactory import CFactory from .CReader import CReader from .CMean import CMeanReader
""" Dynamic Query Class """ # Copyright (c) 2021-, Tellor Development Community # Distributed under the terms of the MIT License. from abc import ABC from abc import abstractmethod from pydantic import Field from telliot.queries.query import OracleQuery from web3 import Web3 class DynamicQuery(OracleQuery, ABC): """Dynamic OracleQuery A dynamic OracleQuery is a parameterized query that supports multiple values for tip data and request ID, depending upon its configuration. """ #: type identifier to help serialization type: str = Field("DynamicQuery", constant=True) @property def request_id(self) -> bytes: """Return the modern or legacy request ID Returns: bytes: 32-byte Request ID """ return bytes(Web3.keccak(self.tip_data)) @abstractmethod def check_parameters(self) -> bool: """Check query parameters This method must validate all query parameters to ensuree that the query is ready to generate proper tip data, request id, and response type. Returns: True if all query parameters are valid """ pass
package org.apache.tapestry5.integration.app1.pages; /** * */ public class MixinVsInformalParameter { void onActionFromFrog() { } }
// Generated by script, don't edit it please. import createSvgIcon from '../../createSvgIcon'; import Android2Svg from '@rsuite/icon-font/lib/legacy/Android2'; const Android2 = createSvgIcon({ as: Android2Svg, ariaLabel: 'android 2', category: 'legacy', displayName: 'Android2' }); export default Android2;
<reponame>MiladHajiShafiee/smartphone-sensors<filename>source/components/Maps.js // import React, { Component } from "react"; // import { Text, View, StyleSheet, Dimensions } from "react-native"; // import MapView from "react-native-maps"; // class Maps extends Component { // state = { // focusedLocation: { // latitude: 38.066666, // longitude: 46.299999, // latitudeDelta: 0.0122, // longitudeDelta: // (Dimensions.get("window").width / Dimensions.get("window").height) * // 0.0122 // } // }; // render() { // return ( // <View> // <MapView // initialRegion={this.state.focusedLocation} // style={styles.map} // /> // </View> // ); // } // } // const styles = StyleSheet.create({ // map: { // width: "100%", // height: 250 // } // }); // export default Maps;
export declare enum AccessQualifier { ReadOnly = 0, WriteOnly = 1, ReadWrite = 2, Max = 2147483647 }
void swap(int &a, int &b) { int temp = a; a = b; b = temp; } int a = 5; int b = 10; swap(a, b); cout << "a: " << a << "; b: " << b << endl;
regexp=^[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}$ echo LEASE0: "${LEASE0}" echo LEASE1: "${LEASE1}" [[ "${LEASE0}" =~ $regexp ]] [[ "${LEASE1}" =~ $regexp ]]
<gh_stars>1-10 /******************************************************************************* * Copyright 2016 * Ubiquitous Knowledge Processing (UKP) Lab * Technische Universität Darmstadt * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ package de.tudarmstadt.ukp.semsearch.cuneiform.dhd2017.annotator; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.text.Normalizer; import java.util.HashMap; import java.util.LinkedList; import org.apache.uima.UimaContext; import org.apache.uima.analysis_engine.AnalysisEngineProcessException; import org.apache.uima.fit.component.JCasAnnotator_ImplBase; import org.apache.uima.fit.descriptor.ConfigurationParameter; import org.apache.uima.fit.util.JCasUtil; import org.apache.uima.jcas.JCas; import org.apache.uima.resource.ResourceInitializationException; import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token; import de.tudarmstadt.ukp.semsearch.cuneiform.dhd2017.type.AlternativeSpelling; import de.tudarmstadt.ukp.semsearch.cuneiform.dhd2017.type.Hypernym; /** * This Analysis Engine annotates the document with hypernyms and alternative * spellings from the self defined dictionary. The annotations are stored in the * Hypernym and AlternativeSpelling annotation type * * @author <NAME> */ public class OwnDictionaryAnnotator extends JCasAnnotator_ImplBase { /** * Load the alternative spelling model from this location. */ public static final String PARAM_ALTERNATIVE_SPELLING_MODEL_LOCATION = "alternativeSpellingModelLocation"; @ConfigurationParameter(name = PARAM_ALTERNATIVE_SPELLING_MODEL_LOCATION, mandatory = true) protected String alternativeSpellingModelLocation; /** * Load the hypernyms model from this location. */ public static final String PARAM_HYPERNYM_MODEL_LOCATION = "hypernymModelLocation"; @ConfigurationParameter(name = PARAM_HYPERNYM_MODEL_LOCATION, mandatory = true) protected String hypernymModelLocation; /** * Alternative-Spelling-Dictionary. * Saves the different spellings in the following fashion: * Word -> Id * All entries sharing the same Id are synonyms. */ private HashMap<String, String> spellings; /** * Hypernym-Dictionary. * Saves a Hypernym in the following fashion: * Word -> List of Id (separated by a space-character) * A Word can have multiple Hypernyms. * E.g.: Hawk -> 3, 12 (where 3 is the id of "bird" and 12 the id of "animal"). */ private HashMap<String, String> hypernyms; /** * A Map used to backward-link all spellings to their id. * The idea behind this is to cover hypernym annotations for words which are not explicitly covered * in the hypernym dictionary but with an alternative spelling defined in the alternative spelling dictionary. * * Example: The hawk flies with a great speed. * Alternative Spelling: 12: hawk;falcon * Hypernym: 15:bird:falcon;pigeon * Now hawk will be annotated with "bird" as its hypernym since falcon is covered by the hypernym dictionary * and hawk is an alternative spelling of falcon. */ private HashMap<String, LinkedList<String>> reverseMap; @Override public void initialize(final UimaContext context) throws ResourceInitializationException { super.initialize(context); try { //Initializing the dictionaries. spellings = new HashMap<String, String>(512); hypernyms = new HashMap<String, String>(512); reverseMap = new HashMap<String, LinkedList<String>>(); loadMap(spellings, alternativeSpellingModelLocation, reverseMap, false); loadMap(hypernyms, hypernymModelLocation, null, true); } catch (IOException e) { e.printStackTrace(); } } @Override public void process(JCas aJCas) throws AnalysisEngineProcessException { for (Token token : JCasUtil.select(aJCas, Token.class)) { if (annotateIfCovered(aJCas, flattenToAscii(token.getCoveredText()).toLowerCase(), token.getBegin(), token.getEnd())) continue; else annotateIfCovered(aJCas, flattenToAscii(token.getLemma().getValue()).toLowerCase(), token.getBegin(), token.getEnd()); } } /** * If the given word is covered by the dictionary, this method * creates an alternative spelling annotation and/or a hypernym annotation * to the given JCAS Object with the given bounds (start, end). * @param aJCas The JCas Object * * @param word The word to be looked for in the dictionary * @param begin Begin of the annotation * @param end End of the annotation * @return Returns true when an annotation was created, false otherwise. */ private boolean annotateIfCovered(JCas aJCas, String word, int begin, int end) { boolean ret = false; if (spellings.containsKey(word)) { AlternativeSpelling aw = new AlternativeSpelling(aJCas, begin, end); aw.setAlternativeSpelling(spellings.get(word)); aw.addToIndexes(); ret = true; } if (hypernyms.containsKey(word)) { Hypernym hy = new Hypernym(aJCas, begin, end); hy.setHypernym(hypernyms.get(word)); hy.addToIndexes(); ret = true; } else if (spellings.containsKey(word)) for (String s : reverseMap.get(spellings.get(word))) if (hypernyms.containsKey(s)) { Hypernym hy = new Hypernym(aJCas, begin, end); hy.setHypernym(hypernyms.get(s)); hy.addToIndexes(); ret = true; break; } return ret; } /** * Reads in the file given in filePath and writes the entries of the dictionary to the map. * @param map The map to be filled- * @param filePath Path of the dictionary * @param reverseMap A reverse Map if needed. Pass null if not needed. * @param secondColumn Used to differentiate the different dictionary-types. * I.e. Alternative Spelling (false): id:As1;As2;...;AsN * Hypernyms (true): id:hyper1;hyper2..;hyperN:hypo1;hypo2;...;hypoN * @throws IOException */ private void loadMap(HashMap<String, String> map, String filePath, HashMap<String, LinkedList<String>> reverseMap, boolean secondColumn) throws IOException { File file = new File(filePath); Reader fileReader = new InputStreamReader(new FileInputStream(file), "UTF-8"); @SuppressWarnings("resource") BufferedReader bufferedReader = new BufferedReader(fileReader); String line; String index; boolean multilinecomment = false; while ((line = bufferedReader.readLine()) != null) { // Handle Multi-line comment if (line.contains("/*") && !line.contains("*/")) multilinecomment = true; if (multilinecomment && line.contains("*/")) { multilinecomment = false; int offset = line.indexOf("*/"); line = line.substring(offset, line.length()); } if (multilinecomment) continue; // Handle Line-comments(//) and embedded multi-line comments line = line.replaceAll("//.*|/\\*((.|\\n)(?!=*/))+\\*/", ""); line = line.replaceAll("\\s+", " ").trim(); // Ignore empty or invalid entries if (line.length() == 0 || !line.contains(":")) continue; String[] parts = line.split("(?<!\\\\):", (secondColumn) ? 3 : 2); index = parts[0].trim(); String[] allWritings = null; if (!secondColumn) allWritings = parts[1].split("(?<!\\\\);"); else allWritings = parts[2].split("(?<!\\\\);"); LinkedList<String> ll = new LinkedList<String>(); for (String aWriting : allWritings) { aWriting = flattenToAscii(aWriting).toLowerCase().trim(); if (aWriting.length() > 0) { if (!map.containsKey(aWriting)) map.put(aWriting, index); else { if (!secondColumn) continue; String newIndex = index + " " + map.get(aWriting); map.put(aWriting, newIndex); } if (reverseMap != null) ll.add(aWriting); } } if (reverseMap != null) reverseMap.put(index, ll); } } /** * Normalizes all special string character into their corresponding ASCII character. * @param string The string to be flattened. * @return The flattened string. */ public static String flattenToAscii(String string) { char[] out = new char[string.length()]; string = Normalizer.normalize(string, Normalizer.Form.NFD); int j = 0; for (int i = 0, n = string.length(); i < n; ++i) { char c = string.charAt(i); if (c <= '\u007F') out[j++] = c; } return new String(out); } }
#!/bin/bash # build and pack a rust lambda library # https://aws.amazon.com/blogs/opensource/rust-runtime-for-aws-lambda/ HOOKS_DIR="$PWD/.lambda-rust" INSTALL_HOOK="install" BUILD_HOOK="build" PACKAGE_HOOK="package" set -eo pipefail mkdir -p target/lambda export PROFILE=${PROFILE:-release} export PACKAGE=${PACKAGE:-true} export DEBUGINFO=${DEBUGINFO} export CARGO_HOME="/opt/rust/cargo" export RUSTUP_HOME="/opt/rust/rustup" # cargo uses different names for target # of its build profiles if [[ "${PROFILE}" == "release" ]]; then TARGET_PROFILE="${PROFILE}" else TARGET_PROFILE="debug" fi export CARGO_TARGET_DIR=$PWD/target/lambda ( if [[ $# -gt 0 ]]; then yum install -y "$@" fi if test -f "$HOOKS_DIR/$INSTALL_HOOK"; then echo "Running install hook" /bin/bash "$HOOKS_DIR/$INSTALL_HOOK" echo "Install hook ran successfully" fi # source cargo . $CARGO_HOME/env CARGO_BIN_ARG="" && [[ -n "$BIN" ]] && CARGO_BIN_ARG="--bin ${BIN}" # cargo only supports --release flag for release # profiles. dev is implicit if [ "${PROFILE}" == "release" ]; then cargo build ${CARGO_BIN_ARG} ${CARGO_FLAGS:-} --${PROFILE} else cargo build ${CARGO_BIN_ARG} ${CARGO_FLAGS:-} fi if test -f "$HOOKS_DIR/$BUILD_HOOK"; then echo "Running build hook" /bin/bash "$HOOKS_DIR/$BUILD_HOOK" echo "Build hook ran successfully" fi ) 1>&2 function package() { file="$1" OUTPUT_FOLDER="output/${file}" if [[ "${PROFILE}" == "release" ]] && [[ -z "${DEBUGINFO}" ]]; then objcopy --only-keep-debug "$file" "$file.debug" objcopy --strip-debug --strip-unneeded "$file" objcopy --add-gnu-debuglink="$file.debug" "$file" fi rm "$file.zip" > 2&>/dev/null || true rm -r "${OUTPUT_FOLDER}" > 2&>/dev/null || true mkdir -p "${OUTPUT_FOLDER}" cp "${file}" "${OUTPUT_FOLDER}/bootstrap" cp "${file}.debug" "${OUTPUT_FOLDER}/bootstrap.debug" > 2&>/dev/null || true if [[ "$PACKAGE" != "false" ]]; then zip -j "${CARGO_TARGET_DIR}/${TARGET_PROFILE}/$file.zip" "${OUTPUT_FOLDER}/bootstrap" if test -f "$HOOKS_DIR/$PACKAGE_HOOK"; then echo "Running package hook" /bin/bash "$HOOKS_DIR/$PACKAGE_HOOK" $file echo "Package hook ran successfully" fi fi } cd "${CARGO_TARGET_DIR}/x86_64-unknown-linux-musl/${TARGET_PROFILE}" ( . $CARGO_HOME/env if [ -z "$BIN" ]; then IFS=$'\n' for executable in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | .targets[] | select(.kind[] | contains("bin")) | .name'); do package "$executable" done else package "$BIN" fi ) 1>&2
#!/bin/bash -le #PBS -N EM_rim135 #PBS -l walltime=48:00:00 #PBS -o Output.job #PBS -j oe #PBS -l nodes=1:ppn=20 #PBS -M jakub.krajniak@cs.kuleuven.be #PBS -A lp_polymer_goa_project module purge module load GROMACS MDRUN="mdrun_mpi -cpi state.cpt -v" GROMPP="grompp_mpi" cd $PBS_O_WORKDIR # Set up OpenMPI environment n_proc=$(cat $PBS_NODEFILE | wc -l) n_node=$(cat $PBS_NODEFILE | uniq | wc -l) mpdboot -f $PBS_NODEFILE -n $n_node -r ssh -v LOG="${PBS_O_WORKDIR}/${PBS_JOBID}.log" function logg() { echo ">>>>>> $1" &>> $LOG } FIRST_STEP=1 LAST_DIR="" EQ_FILES="em.mdp nvt.mdp npt.mdp npt_final.mdp nvt_final.mdp" ROOT_FILES="topol.top ter.itp" for eq in $EQ_FILES; do logg "Start $eq" if [ ! -f $eq ]; then logg "No file $eq" exit 1 fi NEW_DIR="`basename $eq .mdp`" if [ -d $NEW_DIR ]; then if [ -f "${NEW_DIR}/done" ]; then logg "Step $eq exists and it's done" LAST_DIR=$NEW_DIR FIRST_STEP=0 continue else rm -rvf $NEW_DIR &>> $LOG mkdir $NEW_DIR fi else mkdir $NEW_DIR fi if [ "$FIRST_STEP" = "1" ]; then cp -v conf.gro $NEW_DIR/ &>> $LOG else cp -v ${LAST_DIR}/confout.gro $NEW_DIR/conf.gro &>> $LOG fi cp -v $eq $NEW_DIR/ &>> $LOG cd $NEW_DIR for rf in $ROOT_FILES; do ln -s ../$rf . &>> $LOG done $GROMPP -f $eq [ "$?" != "0" ] && exit $? mpirun -n $n_proc $MDRUN [ "$?" != "0" ] && exit $? LAST_DIR=$NEW_DIR FIRST_STEP=0 touch "done" cd .. done
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.dtstack.flinkx.connector.hbase14.table; import com.dtstack.flinkx.table.options.BaseFileOptions; import org.apache.flink.configuration.ConfigOption; import org.apache.flink.configuration.ConfigOptions; import org.apache.flink.configuration.MemorySize; import java.time.Duration; import java.util.HashMap; import java.util.Map; public class HBaseOptions extends BaseFileOptions { public static final ConfigOption<String> TABLE_NAME = ConfigOptions.key("table-name") .stringType() .noDefaultValue() .withDescription("The name of HBase table to connect."); public static final ConfigOption<String> ZOOKEEPER_QUORUM = ConfigOptions.key("zookeeper.quorum") .stringType() .noDefaultValue() .withDescription("The HBase Zookeeper quorum."); public static final ConfigOption<String> ZOOKEEPER_ZNODE_PARENT = ConfigOptions.key("zookeeper.znode.parent") .stringType() .defaultValue("/hbase") .withDescription("The root dir in Zookeeper for HBase cluster."); public static final ConfigOption<String> NULL_STRING_LITERAL = ConfigOptions.key("null-string-literal") .stringType() .defaultValue("null") .withDescription( "Representation for null values for string fields. HBase source and sink encodes/decodes empty bytes as null values for all types except string type."); public static final ConfigOption<MemorySize> SINK_BUFFER_FLUSH_MAX_SIZE = ConfigOptions.key("sink.buffer-flush.max-size") .memoryType() .defaultValue(MemorySize.parse("2mb")) .withDescription( "Writing option, maximum size in memory of buffered rows for each writing request. This can improve performance for writing data to HBase database, but may increase the latency. Can be set to '0' to disable it. "); public static final ConfigOption<Integer> SINK_BUFFER_FLUSH_MAX_ROWS = ConfigOptions.key("sink.buffer-flush.max-rows") .intType() .defaultValue(1000) .withDescription( "Writing option, maximum number of rows to buffer for each writing request. This can improve performance for writing data to HBase database, but may increase the latency. Can be set to '0' to disable it."); public static final ConfigOption<Duration> SINK_BUFFER_FLUSH_INTERVAL = ConfigOptions.key("sink.buffer-flush.interval") .durationType() .defaultValue(Duration.ofSeconds(1L)) .withDescription( "Writing option, the interval to flush any buffered rows. This can improve performance for writing data to HBase database, but may increase the latency. Can be set to '0' to disable it. Note, both 'sink.buffer-flush.max-size' and 'sink.buffer-flush.max-rows' can be set to '0' with the flush interval set allowing for complete async processing of buffered actions."); public static Map<String, Object> getHadoopConfig(Map<String, String> tableOptions) { Map<String, Object> hadoopConfig = new HashMap<>(); if (hasHadoopConfig(tableOptions)) { tableOptions.keySet().stream() .filter((key) -> key.startsWith("properties.")) .forEach( (key) -> { String value = tableOptions.get(key); String subKey = key.substring("properties.".length()); hadoopConfig.put(subKey, value); }); } return hadoopConfig; } private static boolean hasHadoopConfig(Map<String, String> tableOptions) { return tableOptions.keySet().stream().anyMatch((k) -> k.startsWith("properties.")); } }
#!/bin/bash #arguments are strings to censore for string in "$@" do echo "" echo "================ Censoring string "$string": ================" ~/dotfiles/gitflow/replaceStringInWholeGitHistory.sh "$string" "********" done echo "When done - git push <remote> -f --all"
Neural network architecture: Input Layer – This layer is responsible for taking input data as input. Embedding Layer – The purpose of this layer is to convert the input data into numeric representation and provide learnable parameters to represent the data. GCN/Attention Layer – This layer can either be a Graph Convolutional Network (GCN) or an Attention Layer. This layer performs feature extraction on the input data to identify important features. Fully Connected Layer – This layer connects the input from the GCN/Attention layer to the output neurons. The final output will be nine neurons each representing a gender. Output Layer – This layer is responsible for performing the classification using the extracted features from the previous layer.
#cpv() { # rsync -pogbr -hhh --backup-dir=/tmp/rsync -e /dev/null --progress "$@" #} #compdef _files cpv # # mytest(){ echo "`date` $@" } cc="" function listMytestComplections { #echo "$cc " #if [ -n $cc ];then # cc="`date` 123" # echo "`date`" #fi reply=( abc abc:zhl abc test test:zhl testCompectrl ); } #compctl -K listMytestComplections mytest compctl -K listMytestComplections mytest
#!/usr/bin/env bash setup_gitconfig () { local local_git_config=modules/git/gitconfig.local if ! [ -f $local_git_config ] then # git_credential='cache' if platform::is_osx then git_credential='osxkeychain' fi prompt::author sed -e "s/AUTHORNAME/$GIT_AUTHOR_NAME/g" \ -e "s/AUTHOREMAIL/$GIT_AUTHOR_EMAIL/g" \ -e "s/GIT_CREDENTIAL_HELPER/$git_credential/g" \ $local_git_config.tmpl > $local_git_config log::success "generated $local_git_config" else log::success 'skipped gitconfig generation as present' fi } . "$DOTFILES/scripts/core/main.sh" . "$DOTFILES/modules/git/setup.prompt.sh" . "$DOTFILES/modules/git/setup.github.sh" setup_gitconfig feedback::ask_for_confirmation "Do you want to setup github?" if feedback::answer_is_yes then install::package "Github CLI" "gh" install::package "GPG" "gpg" github::setup fi
<reponame>lixinrongNokia/GeneralManagement<filename>src/main/java/com/gzwl/demo/service/sys/impl/DictionaryTypeServiceImpl.java package com.gzwl.demo.service.sys.impl; import java.util.List; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.gzwl.demo.pojo.DictionaryType; import com.gzwl.demo.pojo.DictionaryTypeExample; import com.gzwl.demo.search.sys.DictionaryTypeSearch; import com.gzwl.demo.service.AbstraceService; import com.gzwl.demo.service.sys.DictionaryTypeService; import com.gzwl.demo.util.ResultUtil; /** * * @version:1.0 * @Description:字典类型的接口实现类 * @author:李云飞 * @date: 2019年3月29日上午11:47:01 */ @Service @Transactional public class DictionaryTypeServiceImpl extends AbstraceService implements DictionaryTypeService { /** * 新增 */ @Override public int insert(DictionaryType dictionaryType) { return dictionaryTypeMapper.insertSelective(dictionaryType); } /** * 修改 */ @Override public int updateSelective(DictionaryType dictionaryType) { return dictionaryTypeMapper.updateByPrimaryKeySelective(dictionaryType); } /** * 查询所有表(只查询表类型的) * * @return */ public List<DictionaryType> ListByTable() { DictionaryTypeExample example = new DictionaryTypeExample(); DictionaryTypeExample.Criteria criteria = example.createCriteria(); criteria.andDictionaryTypeTypeEqualTo_alias("1"); return dictionaryTypeMapper.customizationSelectByExample(example); } /** * 查询 or 条件查询 */ @Override public ResultUtil ListByPage(DictionaryTypeSearch dictionaryTypeSearch) { PageHelper.startPage(dictionaryTypeSearch.getPage(), dictionaryTypeSearch.getLimit()); DictionaryTypeExample example = new DictionaryTypeExample(); DictionaryTypeExample.Criteria criteria = example.createCriteria(); if (null != dictionaryTypeSearch.getDictionaryTypeName() && !"".equals(dictionaryTypeSearch.getDictionaryTypeName())) { criteria.andDictionaryTypeNameLike_alias("%" + dictionaryTypeSearch.getDictionaryTypeName() + "%"); } if (null != dictionaryTypeSearch.getDictionaryTypeValue() && !"".equals(dictionaryTypeSearch.getDictionaryTypeValue())) { criteria.andDictionaryTypeValueLike_alias("%" + dictionaryTypeSearch.getDictionaryTypeValue() + "%"); } if (null != dictionaryTypeSearch.getDictionaryTypeType() && !"".equals(dictionaryTypeSearch.getDictionaryTypeType())) { criteria.andDictionaryTypeTypeEqualTo_alias(dictionaryTypeSearch.getDictionaryTypeType()); } List<DictionaryType> logs = dictionaryTypeMapper.customizationSelectByExample(example); PageInfo<DictionaryType> pageInfo = new PageInfo<DictionaryType>(logs); ResultUtil resultUtil = new ResultUtil(); resultUtil.setCode(0); resultUtil.setCount(pageInfo.getTotal()); resultUtil.setData(pageInfo.getList()); return resultUtil; } /** * 根据id查询 */ @Override public DictionaryType getById(Integer dictionaryTypeId) { return dictionaryTypeMapper.selectByPrimaryKey(dictionaryTypeId); } /** * 根据父ID查询 */ @Override public List<DictionaryType> ListByParentId(Integer parentId) { DictionaryTypeExample example = new DictionaryTypeExample(); DictionaryTypeExample.Criteria criteria = example.createCriteria(); criteria.andParentIdEqualTo_alias(parentId); return dictionaryTypeMapper.customizationSelectByExample(example); } }
import tensorflow as tf # Create a random array of size 64x64x3 tensor = tf.random.uniform([64, 64, 3], 0, 255, dtype=tf.int32) # Create the tensorflow session session = tf.Session() # Create the tensor print(session.run(tensor))
# Script for uploading current package to pypi python3 setup.py sdist bdist_wheel twine upload --skip-existing dist/*
#!/bin/bash function version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } # Pass the version (optional) if [ ! -z "$1" ] then VERSION=$1 else ES_VERSION="$(sudo dpkg -l | grep elasticsearch | awk '{print $3}')" if [ -z "$ES_VERSION" ] then VERSION="6.5.4" else VERSION=$ES_VERSION fi fi # Starting with version 6.3, Kibana includes X-Pack by default, whereas the # embdedded ElasticSearch server that Nuxeo uses does not. So this project now # installs the "oss" version of Kibana, which doesn't include X-Pack. if version_gt "6.3.0" $VERSION; then OSS="" else OSS="-oss" fi ARCH="x86_64" echo "Version to download: $VERSION" cd wget https://artifacts.elastic.co/downloads/kibana/kibana$OSS-$VERSION-linux-$ARCH.tar.gz tar -xvf kibana$OSS-$VERSION-linux-$ARCH.tar.gz mv kibana-$VERSION-linux-$ARCH kibana chown -R ubuntu:ubuntu kibana
package daemon.motorfluxo.protocol; import daemon.motorfluxo.algorithms.distribuicaoTarefasExecutor.ExecutorsThreadsData; import daemon.motorfluxo.application.InitiateFluxController; import daemon.motorfluxo.application.InitiateFluxControllerImpl; import daemon.motorfluxo.presentation.MotorFluxoServer; import eapli.base.Application; import eapli.base.activity.domain.AtividadeAprovacao; import eapli.base.activity.domain.AtividadeRealizacao; import eapli.base.activity.domain.EstadoAtividade; import eapli.base.activity.domain.RealizacaoAutomatica; import eapli.base.pedidoservico.domain.EstadoPedido; import eapli.base.pedidoservico.domain.FluxoAtividadesPedido; import eapli.base.pedidoservico.domain.Pedido; import eapli.base.protocolo.domain.SDP2021Packet; import eapli.base.utils.ANSI; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.util.concurrent.Semaphore; import static eapli.base.protocolo.domain.SDP2021ProtocolTypeMessages.*; public class ManageFluxRequestV1 extends BaseFluxRequest{ private static final Logger LOGGER = LogManager.getLogger(ManageFluxRequestV1.class); private InitiateFluxController controller=new InitiateFluxControllerImpl(); protected final int VERSION=1; // todo ver melhor com os codigos protected ManageFluxRequestV1(final String ticketId) { super (ticketId ); //this.scriptQueue= ExecutorsThreadsData.scriptQueue (); } @Override public SDP2021Packet execute(){ Pedido pedido = controller.getPedido(this.ticketId); if(pedido==null) return this.buildErrorMessage(); return realizarAnalisePedido(pedido); } private SDP2021Packet realizarAnalisePedido(final Pedido pedido){ switch (pedido.estadoAtualPedido()){ case SUBMETIDO: return fazerAnaliseInicialPedido(pedido); case EM_APROVACAO: return verificarAprovacao(pedido); case EM_RESOLUCAO: return finalizarPedido(pedido); default: ANSI.print ( "ERROR",ANSI.RED ); return buildErrorMessage(); } } private SDP2021Packet fazerAnaliseInicialPedido(Pedido pedido) { FluxoAtividadesPedido flux= pedido.fluxoAtividades(); if(flux.hasAtividadeAprovacao()) return iniciarAtividadeAprovacao(pedido); return iniciarExecucaoAtividadeRealizacao(pedido); } private SDP2021Packet iniciarAtividadeAprovacao(Pedido pedido) { FluxoAtividadesPedido fluxo = pedido.fluxoAtividades(); AtividadeAprovacao atividadeAprovacao = fluxo.atividadeAprovacao(); this.updateActivityState(atividadeAprovacao,EstadoAtividade.PRONTO_EXECUTAR); this.updateActivityFluxState(EstadoPedido.EM_APROVACAO,EstadoPedido.EM_APROVACAO.toString()); ANSI.log ( LOGGER::info,"Atividade de aprovacao inicializada", ANSI.CYAN); return new SDP2021Packet ( VERSION, CODIGO_RES_AVANCAR_FLUXO_PEDIDO, START_APPROVAL_TASK, true); } private SDP2021Packet verificarAprovacao(Pedido pedido) { FluxoAtividadesPedido fluxo = pedido.fluxoAtividades(); AtividadeAprovacao atividadeAprovacao = fluxo.atividadeAprovacao(); this.updateActivityState(atividadeAprovacao,EstadoAtividade.CONCLUIDA); boolean result = fluxo.resultadoAprovacao(); if(!result)return acabarPedidoRejeitado(pedido); ANSI.log ( LOGGER::info,"Servico Aprovado", ANSI.YELLOW); this.updateActivityFluxState(EstadoPedido.APROVADO,EstadoPedido.APROVADO.toString()); return iniciarExecucaoAtividadeRealizacao(pedido); } private SDP2021Packet acabarPedidoRejeitado(Pedido pedido) { FluxoAtividadesPedido fluxo = pedido.fluxoAtividades(); AtividadeRealizacao atividadeRealizacao = fluxo.atividadeRealizacao(); this.updateActivityState(atividadeRealizacao,EstadoAtividade.CANCELADA); this.updateActivityFluxState(EstadoPedido.REJEITADO,EstadoPedido.REJEITADO.toString()); ANSI.log ( LOGGER::info,"Servico Rejeitado", ANSI.RED); return new SDP2021Packet ( VERSION, CODIGO_RES_AVANCAR_FLUXO_PEDIDO, TICKET_REJECTED , true); } private SDP2021Packet iniciarExecucaoAtividadeRealizacao(Pedido pedido) { FluxoAtividadesPedido fluxo = pedido.fluxoAtividades(); this.updateActivityFluxState(EstadoPedido.EM_RESOLUCAO,EstadoPedido.EM_RESOLUCAO.toString()); AtividadeRealizacao atividadeRealizacao = fluxo.atividadeRealizacao(); this.updateActivityState(atividadeRealizacao,EstadoAtividade.PRONTO_EXECUTAR); return analisarExecucaoAtividadeRealizacao(pedido); } private SDP2021Packet analisarExecucaoAtividadeRealizacao(Pedido pedido) { FluxoAtividadesPedido fluxo = pedido.fluxoAtividades(); if(fluxo.isRealizacaoAutomatica()) return executarScriptAutomatico(pedido); return iniciarRealizacaoManual(pedido); } public SDP2021Packet executarScriptAutomatico(final Pedido pedido) { int executorResponse=sendScriptToExecutor ( pedido ); logInfo ( "(Ticket id "+this.ticketId+")Script result: "+executorResponse ); if(hasScriptExecutedSuccessfully(executorResponse)){ return finalizarPedido(pedido); } logWarning ( "(Ticket id "+this.ticketId+")There was a problem executing the script" ); return new SDP2021Packet(Application.settings().getSdpProtocolVersion(),CODIGO_ERRO,ERROR_MESSAGE); } private void logInfo(final String text){ ANSI.log (LOGGER::info,text,ANSI.CYAN ); ANSI.print ( text,ANSI.CYAN ); } private void logWarning(final String text){ ANSI.log ( LOGGER::warn,text,ANSI.UNDERLINE_CYAN ); ANSI.print ( text,ANSI.UNDERLINE_CYAN ); } protected int sendScriptToExecutor(final Pedido ticket){ final String script=getScript (ticket); logInfo ( "(Ticket "+ticket.identity ()+")Sending script to executor server" ); ExecutorsThreadsData.offerScriptToQueue (ticketId,script); Semaphore sem=ExecutorsThreadsData.getSemaphoreByTicketId ( ticketId ); System.out.println ("(Ticket "+ticket.identity ()+")got thread semaphore"); try { //wait for the ExecutorHandler thread to get the response from the executor sem.acquire (); System.out.println ("(Ticket "+ticket.identity ()+")acquired thread semaphore"); } catch (InterruptedException e) { e.printStackTrace (); } //apagar entradas do mapa e retornar o resultado da execução return ExecutorsThreadsData.removeData(ticketId); } private String getScript(final Pedido ticket){ return ((RealizacaoAutomatica)ticket .fluxoAtividades () .atividadeRealizacao ()) .getScriptInStringFormat (); } private SDP2021Packet iniciarRealizacaoManual(final Pedido pedido) { boolean realizarAlgoritmoAtribuicao= Application.settings().getAutomaticallyAtributeCollaborators(); if(realizarAlgoritmoAtribuicao) return algoritmoAtribuicao(pedido); ANSI.log ( LOGGER::info,"Atividade de Realizacao a ser Reindivicado", ANSI.GREEN); return new SDP2021Packet ( VERSION, CODIGO_RES_AVANCAR_FLUXO_PEDIDO, START_MANUAL_TASK_EXECUTED, true); } private SDP2021Packet algoritmoAtribuicao(Pedido pedido) { MotorFluxoServer.algorithmColaborador.addAtividade(pedido); ANSI.log ( LOGGER::info,"Colaborador Atribuido automaticamente a atividade", ANSI.GREEN); return new SDP2021Packet ( VERSION, CODIGO_RES_AVANCAR_FLUXO_PEDIDO, ACTIVITY_AUTOMATIC_ATTRIBUTION, true); } private SDP2021Packet finalizarPedido(Pedido pedido) { this.updateActivityFluxState(EstadoPedido.CONCLUIDO,EstadoPedido.CONCLUIDO.toString()); FluxoAtividadesPedido fluxo = pedido.fluxoAtividades(); AtividadeRealizacao atividadeRealizacao = fluxo.atividadeRealizacao(); this.updateActivityState(atividadeRealizacao,EstadoAtividade.CONCLUIDA); ANSI.log ( LOGGER::info,"Servico finalizado com sucesso", ANSI.BOLD_WHITE); return new SDP2021Packet ( VERSION, CODIGO_RES_AVANCAR_FLUXO_PEDIDO, TICKET_CLOSED , true); } }
#!/bin/bash pip install ansible ansible-runner pip install boto3
import type { NextPage } from 'next' import { Box } from '@fower/react' import { Form, useForm } from 'fomir-react' const Home: NextPage = () => { const form = useForm({ onSubmit(values) { console.log('values', values) }, watch: { '$.submitCount': (count, prevCount) => { console.log('submitCount', count, prevCount) }, 'firstName.value': (data, prev) => { console.log('firstName change', data, prev) }, 'firstName.error': (data, prev) => { console.log('firstName error change', data, prev) }, '*.value': (data, prev) => { console.log('values---', data, prev) }, '*.error': (data, prev) => { console.log('error---', data, prev) }, }, children: [ { label: '<NAME>', name: 'firstName', component: 'Input', value: '', validators: { required: 'gogo', }, }, { label: '<NAME>', name: 'lastName', component: 'Input', value: '', }, { component: 'Submit', text: 'submit', }, ], }) return ( <Box p-100> <Form form={form} /> </Box> ) } export default Home
/** * @license * Copyright 2018 The Closure Library Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS-IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const {execute} = require('../../bin/closuremakedeps'); const path = require('path'); const fs = require('fs'); const jasmineDiff = require('jasmine-diff'); // This test isn't that slow unless you're debugging. jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000; const CLOSURE_SUB_DIR = 'closure/goog'; // The entry point of the module is bootstrap/nodejs.js. Need to back out. const CLOSURE_LIBRARY_PATH = path.resolve(require.resolve('google-closure-library'), '../../../../'); const CLOSURE_PATH = path.resolve(CLOSURE_LIBRARY_PATH, CLOSURE_SUB_DIR); const THIRD_PARTY_PATH = path.resolve(CLOSURE_LIBRARY_PATH, 'third_party', CLOSURE_SUB_DIR); /** * @param {string} flag * @param {string} value * @return {!Array<string>} */ function flag(flag, value) { return [flag, value]; } /** * @param {string} p * @return {!Array<string>} */ function exclude(p) { return flag('--exclude', path.resolve(CLOSURE_PATH, p)); } /** * Skips lines for test files, as those are not present in the npm package for * the library. * * * @param {string} line * @return {boolean} */ function skipTests(line) { return !/goog\.addDependency\('[^']*_test\.js/.test(line); } describe('closure-make-deps', function() { beforeEach(function() { jasmine.addMatchers(jasmineDiff(jasmine, { colors: false, inline: false, })); }); it('produces closure library deps file', async function() { const expectedContents = fs.readFileSync(path.resolve(CLOSURE_PATH, 'deps.js'), { encoding: 'utf8' }).replace(/^(\/\/.*)?\n/gm, ''); const flags = [ ...flag('--root', CLOSURE_PATH), ...flag('--root', THIRD_PARTY_PATH), ...exclude('transpile.js'), ...exclude('testing/testdata'), ...exclude('bin'), ...exclude('conformance'), ...exclude('css'), ...exclude('demos'), ...exclude('docs'), ...exclude('transpile'), ...exclude('debug_loader_integration_tests'), ...exclude('base_debug_loader_test.js'), ]; const result = await execute(flags); expect(result.errors.filter(e => e.fatal).map(e => e.toString())) .toEqual([]); let resultLines = result.text.split('\n'); resultLines = resultLines.filter(skipTests); let expectedLines = expectedContents.split('\n'); expectedLines = expectedLines.filter(skipTests); expect(resultLines).toEqual(expectedLines); }); });
<gh_stars>0 function include(url) { const script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } import * as wizard from './Wizard.js' import * as platform from './Platform.js' import * as sphere from './MagicSphere.js' const canvas = document.getElementById('game') const context = canvas.getContext('2d') let BaseURL = "192.168.3.11:1231" let ws = null let PlayerID = Number(localStorage.getItem("PlayerID")) if (PlayerID === null || PlayerID === 0) { PlayerID = Math.floor(Math.random() * 1000000) localStorage.setItem("PlayerID", PlayerID.toString()) } let GameID = Number(localStorage.getItem("GameID")) let messageField = document.getElementById("messageText") messageField.value = GameID let host = document.getElementById("host") host.onclick = async () => { await Host() } let join = document.getElementById("join") join.onclick = () => { Join() } let entities = [] const LEFT_KEY = 65; const RIGHT_KEY = 68; const JUMP_KEY = 32; const ATTACK_KEY = 13; let viewToLeft = false, animationStep = -2, playerAnimType = "stay"; let jumpFrame = 0, runFrame = 0, attackFrame = 1; let controller = { left: false, right: false, up: false, down: false, attack: false, keyListener: function (event) { let keyState = (event.type === "keydown"); switch (event.keyCode) { case LEFT_KEY: controller.left = keyState; if (controller.left) { playerAnimType = "run"; runFrame = 1; } else { playerAnimType = "stay"; } viewToLeft = true; break; case RIGHT_KEY: controller.right = keyState; if (controller.right) { playerAnimType = "run"; runFrame = 1; } else { playerAnimType = "stay"; } viewToLeft = false; break; case JUMP_KEY: controller.up = keyState; if (controller.up) { playerAnimType = "jump"; runFrame = 1; } else { playerAnimType = "stay"; } break; case ATTACK_KEY: controller.attack = keyState; if (keyState) { playerAnimType = "attack"; runFrame = 1; } else { playerAnimType = "stay"; } } } } const background = new Image(); background.src = 'backgrounds/backgroundarenablue2.png'; let spheres = [] let cooldown = 0 let platform_one = new platform.Platform(200, 450) let platform_two = new platform.Platform(400, 350) let platform_three = new platform.Platform(860, 450) let player = new wizard.Wizard(0, 600, 0, 0, PlayerID); let didMove; function shoot() { if (cooldown <= 0) { let bx = player.x; let by = player.y; let bullet = new sphere.MagicSphere(bx, by); spheres.push(bullet); cooldown = 20 } } function bulletsMove(side) { for (let i in spheres) { spheres[i].move(side); spheres[i].draw(context) if (spheres[i].outOfRange()) { delete spheres[i]; } } spheres = spheres.filter(item => item !== undefined); } function game() { context.drawImage(background, 0, 0, 1200, 700); platform_one.draw(context, 150, 100) platform_two.draw(context, 410, 100) platform_three.draw(context, 150, 100) let spheresMoving = function () { if (cooldown > 0) { cooldown-- } else { shoot() if (viewToLeft) { bulletsMove("left") } else bulletsMove("right") } } let playerMoving = function () { let bullet = new Image() bullet.src = 'playerAnim/WizardImg/Fire/fire1.png' let img = new Image(); if (jumpFrame > 7) { jumpFrame = 0; } if (runFrame > 8) { runFrame = 1; } if (attackFrame > 7) { attackFrame = 1; } if (controller.up && player.jumping === false) { player.dy -= 40; player.jumping = true; console.log(player.y); } if (controller.left) { runFrame++; didMove = true player.dx -= 0.65; } if (controller.right) { runFrame++; player.dx += 0.65; didMove = true } if (!player.on_platform) player.dy += 1.7; player.x += player.dx; // if (player.on_platform) player.y += player.dy; player.dx *= 0.9; player.dy *= 0.9; // CHECK IS ON PLATFORM (150-330 (420), 810-980 (420) , 350-790 (320)) if ((player.x >= 150 && player.x <= 330 && player.y < 420) || (player.x >= 810 && player.x <= 980 && player.y < 420) || (player.x >= 350 && player.x <= 790 && player.y < 320)) { player.on_platform = true; player.jumping = false; player.dy = 0; if (player.x >= 350 && player.x <= 790){ player.y = 320; } else player.y = 420; } else if ((player.x < 150 || player.x > 330) && (player.x < 810 || player.x > 980) && (player.x < 350 || player.x > 790)) { player.on_platform = false; player.jumping = true; } if (player.y > 600) { player.jumping = false; player.y = 600; player.dy = 0; } if (player.x <= 0) { player.x = 0; player.dx = 0; } if (player.x >= 1125) { player.x = 1125; player.dx = 0; } if (playerAnimType === "stay") { img.src = "playerAnim/WizardImg/mage1.png"; if (viewToLeft) { img.src = "playerAnim/WizardImg/mage_reversed.png"; } } else if (player.jumping) { if (viewToLeft) { img.src = "playerAnim/WizardImg/Jump/jump" + runFrame + "r.png" } else { img.src = "playerAnim/WizardImg/Jump/jump" + runFrame + ".png" } jumpFrame++; } else if (playerAnimType === "run") { if (viewToLeft) { img.src = "playerAnim/WizardImg/Run/run" + runFrame + "r.png" } else { img.src = "playerAnim/WizardImg/Run/run" + runFrame + ".png" } runFrame++; } else if (playerAnimType === "attack") { if (viewToLeft) { img.src = "playerAnim/WizardImg/Attack/attack" + attackFrame + "r.png" spheresMoving() } else { img.src = "playerAnim/WizardImg/Attack/attack" + attackFrame + ".png" spheresMoving() } } context.drawImage(img, player.x, player.y, 75, 75); } window.requestAnimationFrame(playerMoving); window.requestAnimationFrame(bulletsMove) if (didMove) { WebSocketUpdatePlayer() } requestAnimationFrame(game); requestAnimationFrame(playerMoving); } document.addEventListener('keydown', controller.keyListener); document.addEventListener('keyup', controller.keyListener); background.onload = function () { game(); } let requestAnimFrame = (function () { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimatoinFrame || window.oRequestAnimationFrame || window.msRequestAnimatoinFrame || function (callback) { window.setTimeout(callback, 1000 / 20); }; })(); // ------------------------ // WebSocket Stuff // ------------------------ function CloseWebSocket() { if (ws === null) { return } ws.close() ws = null } function WebSocketUpdatePlayer() { if (ws === null) { return } let data = {playerUpdate: {x: player.x, y: player.y}, playerId: PlayerID, gameId: GameID} ws.send(JSON.stringify(data)) } function StartWebSocket() { // console.log("PLAYER ID:") // console.log(PlayerID) // console.log("GAME ID:") console.log(GameID) if (ws === null) { let url = `ws://${BaseURL}/connectToGame/${GameID}/${PlayerID}` ws = new WebSocket(url) } else { ws.close() let url = `ws://${BaseURL}/connectToGame/${GameID}/${PlayerID}` ws = new WebSocket(url) } console.log(ws) ws.onmessage = (event) => { let eventData = event.data let data = JSON.parse(eventData) console.log(data) // Load player data on connect if (data.loadData !== undefined) { let loadData = data.loadData let players = loadData.players players.forEach((playerId) => { entities.push(new wizard.Wizard(0, 600, 6, 10, playerId)) }) } // Player Connected if (data.connectPlayer !== undefined) { let playerId = data.connectPlayer console.log(`PLAYER: ${playerId} Connected`) entities.push(new wizard.Wizard(0, 600, 6, 10, playerId)) } // Player Disconnected if (data.disconnectPlayer !== undefined) { let playerId = data.disconnectPlayer console.log(`PLAYER: ${playerId} Disconnected`) let index = entities.findIndex((p) => p.id === playerId) if (index > -1) { entities.splice(index, 1); } } // Update Players if (data.playerUpdate !== undefined) { let playerId = Number(data.playerId) let update = data.playerUpdate let index = entities.findIndex((p) => p.id === playerId) if (index > -1) { let movingPlayer = entities[index] // Move player movingPlayer.x = update.x movingPlayer.y = update.y } } } } async function Host() { GameID = Math.floor(Math.random() * 1000000) localStorage.setItem("GameID", GameID.toString()) messageField.value = GameID let url = `http://${BaseURL}/createGame/${GameID}` let resp = await fetch(url) console.log(resp) StartWebSocket() } function Join() { GameID = Number(messageField.value) localStorage.setItem("GameID", GameID.toString()) StartWebSocket() }
#!/bin/sh if [ -n "$DESTDIR" ] ; then case $DESTDIR in /*) # ok ;; *) /bin/echo "DESTDIR argument must be absolute... " /bin/echo "otherwise python's distutils will bork things." exit 1 esac DESTDIR_ARG="--root=$DESTDIR" fi echo_and_run() { echo "+ $@" ; "$@" ; } echo_and_run cd "/home/ros/lidar_ws/src/joint_state_publisher/joint_state_publisher" # ensure that Python install destination exists echo_and_run mkdir -p "$DESTDIR/home/ros/lidar_ws/install/lib/python2.7/dist-packages" # Note that PYTHONPATH is pulled from the environment to support installing # into one location when some dependencies were installed in another # location, #123. echo_and_run /usr/bin/env \ PYTHONPATH="/home/ros/lidar_ws/install/lib/python2.7/dist-packages:/home/ros/lidar_ws/build/lib/python2.7/dist-packages:$PYTHONPATH" \ CATKIN_BINARY_DIR="/home/ros/lidar_ws/build" \ "/usr/bin/python" \ "/home/ros/lidar_ws/src/joint_state_publisher/joint_state_publisher/setup.py" \ build --build-base "/home/ros/lidar_ws/build/joint_state_publisher/joint_state_publisher" \ install \ $DESTDIR_ARG \ --install-layout=deb --prefix="/home/ros/lidar_ws/install" --install-scripts="/home/ros/lidar_ws/install/bin"
#!/bin/bash echo "Removing /home/pi/lora_gateway/scripts/start_gw.sh in /etc/rc.local if any" sudo sed -i '\/home\/pi\/lora_gateway\/scripts\/start_gw.sh/d' /etc/rc.local echo "Removing /home/pi/lora_gateway/start_upl_pprocessing_gw.sh in /etc/rc.local if any" sudo sed -i '\/home\/pi\/lora_gateway\/start_upl_pprocessing_gw.sh/d' /etc/rc.local echo "Removing /home/pi/lora_gateway/start_lpf_pprocessing_gw.sh in /etc/rc.local if any" sudo sed -i '\/home\/pi\/lora_gateway\/start_lpf_pprocessing_gw.sh/d' /etc/rc.local echo "Restoring /home/pi/lora_gateway/scripts/start_gw.sh in /etc/rc.local" sudo sed -i 's/^exit 0/\/home\/pi\/lora_gateway\/scripts\/start_gw.sh\nexit 0/g' /etc/rc.local echo "Done"
#!/bin/sh while read p ; do pip install $p done < requirements.txt
/*! * Redback * Copyright(c) 2011 <NAME> <<EMAIL>> * MIT Licensed */ /** * Module dependencies. */ var Structure = require('../Structure'); /** * A wrapper for the Redis hash type. * * Usage: * `redback.createHash(key);` * * Reference: * http://redis.io/topics/data-types#hashes * * Redis Structure: * `(namespace:)key = hash(key => value)` */ var Hash = exports.Hash = Structure.new(); /** * Get an array of hash keys. * * @param {Function} callback * @return this * @api public */ Hash.prototype.keys = function (callback) { this.client.hkeys(this.key, callback); return this; } /** * Get an array of hash values. * * @param {Function} callback * @return this * @api public */ Hash.prototype.values = function (callback) { this.client.hvals(this.key, callback); return this; } /** * Get the number of hash keys. * * @param {Function} callback * @return this * @api public */ Hash.prototype.length = function (callback) { this.client.hlen(this.key, callback); return this; } /** * Delete a hash key. * * @param {string} hash_key * @param {Function} callback (optional) * @return this * @api public */ Hash.prototype.delete = Hash.prototype.del = function (hash_key, callback) { callback = callback || function () {}; this.client.hdel(this.key, hash_key, callback); return this; } /** * Checks whether a hash key exists. * * @param {string} hash_key * @param {Function} callback * @return this * @api public */ Hash.prototype.exists = function (hash_key, callback) { this.client.hexists(this.key, hash_key, callback); return this; } /** * Sets one or more key/value pairs. * * To set one key/value pair: * `hash.set('foo', 'bar', callback);` * * To set multiple: * `hash.set({key1:'value1', key2:'value2}, callback);` * * @param {string|Object} hash_key * @param {string} value (optional) * @param {Function} callback (optional) * @return this * @api public */ Hash.prototype.set = function (hash_key, value, callback) { if (typeof hash_key === 'object') { callback = value || function () {}; this.client.hmset(this.key, hash_key, callback); } else { callback = callback || function () {}; this.client.hset(this.key, hash_key, value, callback); } return this; } /** * Sets a key/value pair if the key doesn't already exist. * * @param {string} hash_key * @param {string} value * @param {Function} callback * @return this * @api public */ Hash.prototype.add = function (hash_key, value, callback) { callback = callback || function () {}; this.client.hsetnx(this.key, hash_key, value, callback); return this; } /** * Gets one or more key/value pairs. * * To get all key/value pairs in the hash: * `hash.get('foo', callback);` * * To get certain key/value pairs: * `hash.get(['foo','bar'], callback);` * `hash.get('foo', callback);` * * @param {string} hash_key (optional) * @param {Function} callback * @return this * @api public */ Hash.prototype.get = function (hash_key, callback) { if (typeof hash_key === 'function') { callback = hash_key; this.client.hgetall(this.key, callback); } else if (Array.isArray(hash_key)) { this.client.hmget(this.key, hash_key, callback) } else { this.client.hget(this.key, hash_key, callback); } return this; } /** * Increment the specified hash value. * * @param {string} hash_key * @param {int} amount (optional - default is 1) * @param {Function} callback (optional) * @return this * @api public */ Hash.prototype.increment = Hash.prototype.incrBy = function (hash_key, amount, callback) { callback = callback || function () {}; if (typeof amount === 'function') { callback = amount; amount = 1; } this.client.hincrby(this.key, hash_key, amount, callback); return this; } /** * Decrement the specified hash value. * * @param {string} hash_key * @param {int} amount (optional - default is 1) * @param {Function} callback (optional) * @return this * @api public */ Hash.prototype.decrement = Hash.prototype.decrBy = function (hash_key, amount, callback) { callback = callback || function () {}; if (typeof amount === 'function') { callback = amount; amount = 1; } this.client.hincrby(this.key, hash_key, -1 * amount, callback); return this; }
#!/bin/bash -xe # Copyright 2016-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. . $BUILDER_DIR/CONFIG ### INSTALL AND VALIDATE NODE #### echo "SETTING UP NODE ON THE INSTANCE" yum install -y wget tree mkdir -p $NODE_DIR echo "Downloading node from nodejs.org...." wget https://nodejs.org/dist/v4.4.5/node-v4.4.5-linux-x64.tar.gz -O $BUILDER_DIR/node-v4.4.5-linux-x64.tar.gz tar -zxf $BUILDER_DIR/node-v4.4.5-linux-x64.tar.gz -C $NODE_DIR echo "Validate Node.js got installed." if [ -a $NODE_DIR/node-v4.4.5-linux-x64/bin/node ]; then NODE_VER=`$NODE_DIR/node-v4.4.5-linux-x64/bin/node --version` if [ -z "$NODE_VER" ]; then echo "Node could not be installed. " else echo "Node successfully installed.." fi fi echo "Creating base directories for platform." mkdir -p $BEANSTALK_DIR/deploy/appsource/ mkdir -p /var/app/staging mkdir -p /var/app/current mkdir -p /var/log/nginx/healthd/ chown nginx.nginx /var/log/nginx/healthd/ yum install -y git jq ## WRITE NODE_DIR TO CONFIG ON INSTANCE TO BE AVAILABLE FOR HOOKS mkdir -p $CONTAINER_CONFIG_FILE_DIR echo "NODE_DIR=$NODE_DIR/node-v4.4.5-linux-x64" >> $CONTAINER_CONFIG echo "CONTAINER_SCRIPTS_DIR=$CONTAINER_SCRIPTS_DIR" >> $CONTAINER_CONFIG ##### INSTALL PM2 ###### echo "install pm2 globally" $NODE_DIR/node-v4.4.5-linux-x64/bin/npm install -g minimatch@3.0.4 $NODE_DIR/node-v4.4.5-linux-x64/bin/npm install -g pm2@2.10.4 ls -l $NODE_DIR/node-v4.4.5-linux-x64/bin echo "PATH=$PATH:$NODE_DIR/node-v4.4.5-linux-x64/bin" >> ~/.bashrc PATH=$PATH:$NODE_DIR/node-v4.4.5-linux-x64/bin echo `which pm2` echo "Setting up PM2 log-rotate" $NODE_DIR/node-v4.4.5-linux-x64/bin/pm2 install pm2-logrotate ## Add node path to Beanstalk profile echo "export PATH=$NODE_DIR/node-v4.4.5-linux-x64/bin:\$PATH:/usr/local/bin" >> /opt/elasticbeanstalk/lib/ruby/profile.sh echo "export PM2_HOME=/etc/pm2" >> /opt/elasticbeanstalk/lib/ruby/profile.sh mkdir -p /etc/pm2/ chmod -R 755 /etc/pm2
<reponame>pick-stars/flinkx<gh_stars>1000+ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.dtstack.flinkx.connector.kingbase.dialect; import com.dtstack.flinkx.conf.FlinkxCommonConf; import com.dtstack.flinkx.connector.jdbc.dialect.JdbcDialect; import com.dtstack.flinkx.connector.jdbc.statement.FieldNamedPreparedStatement; import com.dtstack.flinkx.connector.kingbase.converter.KingbaseColumnConverter; import com.dtstack.flinkx.connector.kingbase.converter.KingbaseRawTypeConverter; import com.dtstack.flinkx.connector.kingbase.converter.KingbaseRowConverter; import com.dtstack.flinkx.connector.kingbase.util.KingbaseConstants; import com.dtstack.flinkx.converter.AbstractRowConverter; import com.dtstack.flinkx.converter.RawTypeConverter; import com.dtstack.flinkx.enums.EDatabaseType; import org.apache.flink.table.types.logical.LogicalType; import org.apache.flink.table.types.logical.RowType; import io.vertx.core.json.JsonArray; import java.sql.ResultSet; import java.util.Arrays; import java.util.Optional; import java.util.stream.Collectors; /** * @description: * @program: flinkx-all * @author: lany * @create: 2021/04/26 22:01 */ public class KingbaseDialect implements JdbcDialect { @Override public Optional<String> defaultDriverName() { return Optional.of(KingbaseConstants.DRIVER); } @Override public String dialectName() { return EDatabaseType.KingBase.name(); } @Override public boolean canHandle(String url) { return url.startsWith(KingbaseConstants.URL_PREFIX); } @Override public RawTypeConverter getRawTypeConverter() { return KingbaseRawTypeConverter::apply; } @Override public String quoteIdentifier(String identifier) { return "" + identifier + ""; } @Override public AbstractRowConverter<ResultSet, JsonArray, FieldNamedPreparedStatement, LogicalType> getRowConverter(RowType rowType) { return new KingbaseRowConverter(rowType); } @Override public AbstractRowConverter<ResultSet, JsonArray, FieldNamedPreparedStatement, LogicalType> getColumnConverter(RowType rowType, FlinkxCommonConf commonConf) { return new KingbaseColumnConverter(rowType, commonConf); } @Override public Optional<String> getUpsertStatement( String schema, String tableName, String[] fieldNames, String[] uniqueKeyFields, boolean allReplace) { String uniqueColumns = Arrays.stream(uniqueKeyFields) .map(this::quoteIdentifier) .collect(Collectors.joining(", ")); String updateClause = buildUpdateClause(fieldNames, allReplace); return Optional.of( getInsertIntoStatement(schema, tableName, fieldNames) + " ON CONFLICT (" + uniqueColumns + ") DO UPDATE SET " + updateClause); } /** * if allReplace is true: use ISNULL() FUNCTION to handle null values. For example: SET dname = * isnull(EXCLUDED.dname,t1.dname) else allReplace is false: SET dname = EXCLUDED.dname * * @param fieldNames * @param allReplace * @return */ private String buildUpdateClause(String[] fieldNames, boolean allReplace) { String updateClause; if (allReplace) { updateClause = Arrays.stream(fieldNames) .map( f -> quoteIdentifier(f) + "=ISNULL(EXCLUDED." + quoteIdentifier(f) + ", t1." + quoteIdentifier(f) + ")") .collect(Collectors.joining(", ")); } else { updateClause = Arrays.stream(fieldNames) .map(f -> quoteIdentifier(f) + "=EXCLUDED." + quoteIdentifier(f)) .collect(Collectors.joining(", ")); } return updateClause; } /** * override: add alias for table which is used in upsert statement * * @param schema * @param tableName * @param fieldNames * @return */ @Override public String getInsertIntoStatement(String schema, String tableName, String[] fieldNames) { String columns = Arrays.stream(fieldNames) .map(this::quoteIdentifier) .collect(Collectors.joining(", ")); String placeholders = Arrays.stream(fieldNames).map(f -> ":" + f).collect(Collectors.joining(", ")); return "INSERT INTO " + buildTableInfoWithSchema(schema, tableName) + " t1 " + "(" + columns + ")" + " VALUES (" + placeholders + ")"; } @Override public String getRowNumColumn(String orderBy) { return String.format("row_number() over(%s) as FLINKX_ROWNUM", orderBy); } }
<reponame>penumatsap/hadoop-solr package com.lucidworks.hadoop.io; import java.io.IOException; import com.lucidworks.hadoop.utils.ZipFileRecordReader; import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapred.FileInputFormat; import org.apache.hadoop.mapred.FileSplit; import org.apache.hadoop.mapred.InputSplit; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.RecordReader; import org.apache.hadoop.mapred.Reporter; /** * Extends the basic FileInputFormat class provided by Apache Hadoop to accept * ZIP files. It should be noted that ZIP files are not 'splittable' and each * ZIP file will be processed by a single Mapper. */ public class ZipFileInputFormat extends FileInputFormat<Text, BytesWritable> { /** * See the comments on the setLenient() method */ private static boolean isLenient = false; /** * @param lenient */ public static void setLenient(boolean lenient) { isLenient = lenient; } public static boolean getLenient() { return isLenient; } @Override public RecordReader<Text, BytesWritable> getRecordReader(InputSplit arg0, JobConf arg1, Reporter arg2) throws IOException { return new ZipFileRecordReader((FileSplit) arg0, arg1); } }
<gh_stars>0 import { OutputErrors } from './types'; import { Signals } from '../../signals'; declare type Data = { output: Signals; idealOutput: Signals; }; declare const calcErrorsWithTeacher: ({ output, idealOutput }: Data) => Promise<OutputErrors>; export default calcErrorsWithTeacher;
<reponame>smagill/opensphere-desktop package io.opensphere.core.util; import java.util.Collection; import java.util.List; import java.util.function.Consumer; import io.opensphere.core.util.collections.New; import io.opensphere.core.util.concurrent.ProcrastinatingExecutor; /** * Aggregates items. * * @param <T> the type of the items */ public class TimeAggregator<T> { /** The items. */ private final List<T> myItems; /** The processor. */ private final Consumer<List<T>> myProcessor; /** The executor. */ private final ProcrastinatingExecutor myExecutor; /** * Constructor. * * @param processor the item processor * @param minDelayMilliseconds The minimum delay between when a task is submitted and when it is executed. * @param maxDelayMilliseconds The (best effort) maximum delay between when one task is submitted and when the latest task is * executed. This will not cause multiple tasks to be executed concurrently, regardless of how long they take. */ public TimeAggregator(Consumer<List<T>> processor, int minDelayMilliseconds, int maxDelayMilliseconds) { myItems = New.list(); myProcessor = processor; myExecutor = new ProcrastinatingExecutor("TimeAggregator", minDelayMilliseconds, maxDelayMilliseconds); } /** * Adds an item. * * @param item the item */ public synchronized void addItem(T item) { myItems.add(item); myExecutor.execute(this::processAll); } /** * Adds items. * * @param items the items */ public synchronized void addItems(Collection<? extends T> items) { myItems.addAll(items); myExecutor.execute(this::processAll); } /** * Processes all the items. */ public synchronized void processAll() { if (!myItems.isEmpty()) { myProcessor.accept(New.list(myItems)); myItems.clear(); } } }
/** * En este Controller es para realizar consultas filtradas a las tablas (Administrativo y Persona) * en esta tabla se realiaran una sola consulta a las dos tablas para simular que es una tabla. */ import { Request, Response } from "express"; import pool from "../utils/database"; class AdministrativoFilterController{ public async list(req: any, res: Response){ // Se debe validar si el usuario tiene el privilegio de ejecutar este método. if (req.pleer != 2) res.status(404).send('No tienes permiso para leer a estos administrativos'); const administrativo = (await pool.query('SELECT * FROM vista_administrativos;')); res.json (administrativo); } public async getOne (req: Request, res: Response): Promise<any>{ const {id} = req.params; try { const administrativo = (await pool.query('CALL get_administrativo(?);', [id]))[0][0]; res.json (administrativo); res.json({text: 'El Administrativo Filtrado fué encontrado.'}); } catch (e) { console.log(e) res.status(404).json({text: "El Administrativo Filtrado no existe"}); } } } const cController = new AdministrativoFilterController(); export default cController;
/bin/bash -c \ "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"