This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
supplier_name: Vendor2 | |
# All vendor endpoints that will be generated in the network client. | |
endpoints: | |
- Auth | |
- Search | |
# Endpoints that will be in the service, called sequentially in the given order | |
mapping: | |
Search: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
supplier_name: Vendor1 | |
# All vendor endpoints that will be generated in the network client. | |
endpoints: | |
- Search | |
# Endpoints that will be in the service, called sequentially in the given order | |
mapping: | |
Search: | |
- Search |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.someRandomVendor.search | |
private[search] class SomeRandomVendorSearchService( | |
client: SomeRandomVendorClient, | |
requestMapper: Mapper[SearchRequest, SomeRandomVendorSearchRequest], | |
responseMapper: Mapper[SomeRandomVendorSearchResponse, SearchResponse]) extends SearchService { | |
override def search(request: SearchRequest): Future[SearchResponse] = { | |
for { | |
//validate request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package $package$.search | |
private[search] class $Supplier$SearchService( | |
client: $Supplier$Client, | |
requestMapper: Mapper[SearchRequest, $Supplier$SearchRequest], | |
responseMapper: Mapper[$Supplier$SearchResponse, SearchResponse]) extends SearchService { | |
override def search(request: SearchRequest): Future[SearchResponse] = { | |
for { | |
//validate request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//list of integers | |
val myList: List[Int] = List(1, 2, 7, 3, 6, 4) | |
//predicate function to check whether a number is odd or not | |
def isOdd: Int => Boolean = value => value % 2 == 1 | |
//create a new list containing only odd elements | |
myList.filter(isOdd) //output: List(1, 7, 3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//list of integers | |
val myList: List[Int] = List(1, 2, 7, 3) | |
//function to give neighbouring integers of an integer | |
def neighbourFunc: Int => List[Int] = value => List(value - 1, value + 1) | |
//using map() will give us an unflattened list | |
myList.map(neighbourFunc) //output: List(List(0, 2), List(1, 3), List(6, 8), List(2, 4)) | |
//using map() + flatten() will give us a flattened list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List(1, 2, 7, 3).map(value => value * 2) //output: List(2, 4, 14, 6) | |
List(1, 2, 7, 3).map(_ * 2) //output: List(2, 4, 14, 6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//list of integers | |
val myList: List[Int] = List(1,2,7,3) | |
//function to multiply an integer by 2 | |
def doubleUpFunction: Int => Int = value => value*2 | |
//creating a new list multiplying each element by 2 | |
myList.map(element => doubleUpFunction(element)) //output: List(2, 4, 14, 6) | |
//or simply |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Script to access server boxes | |
#Put the script in any directory present on system's $PATH. Make the file executable via "chmod +x portkey". Then use "portkey help" for instructions on how to use. | |
#Prerequirements: Install JQ and Sponge | |
homeDir=$( echo $HOME ) | |
configFile="${homeDir}/portkey.conf" | |
paramCount="$#" | |
if [ "$paramCount" = "0" ] || [ "$1" = "help" ] |