Skip to content

Instantly share code, notes, and snippets.

Last active March 29, 2019 10:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Ballerina service to get quotes from Game of Thrones(with annotations and trimmed)
import ballerina/http;
import ballerina/log;
import ballerinax/kubernetes;
import ballerinax/openshift;
@openshift:Route {
host: ""
@kubernetes:Service {}
listener http:Listener gotServiceEP = new(9090); // ballerina service endpoint
http:Client gotQuoteAPI = new(""); // game of thrones API endpoint
@kubernetes:Deployment {
namespace: "got-quote-proj",
registry: "",
buildImage: false,
buildExtension: "openshift"
@http:ServiceConfig {
basePath: "/got" // basepath for my service
service gotService on gotServiceEP {
# Validates character.
# + character - Game of Thrones character.
# + return - Untainted character or error if invalid character.
function validateCharacter(string character) returns string|error {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment