blob: 441b4b972973b10616d363de70d918bae450d6d2 [file] [log] [blame]
sslobodr392ebd52019-01-18 12:41:49 -05001/*
2 * Copyright 2018-present Open Networking Foundation
3
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16// gRPC affinity router with active/active backends
17
18package afrouter
19
sslobodr8e2ccb52019-02-05 09:21:47 -050020//import "github.com/opencord/voltha-go/common/log"
21
sslobodr392ebd52019-01-18 12:41:49 -050022func strIndex(ar []string, match string) int {
Kent Hagerman0ab4cb22019-04-24 13:13:35 -040023 for idx, v := range ar {
sslobodr8e2ccb52019-02-05 09:21:47 -050024 if v == match {
sslobodr392ebd52019-01-18 12:41:49 -050025 return idx
26 }
27 }
28 return 0
29}