This file contains hidden or 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
public type CacheConfig record {| | |
int capacity = 100; | |
AbstractEvictionPolicy evictionPolicy = new LruEvictionPolicy(); | |
float evictionFactor = 0.25; | |
int defaultMaxAgeInSeconds = -1; | |
int cleanupIntervalInSeconds?; | |
|}; |
This file contains hidden or 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
public type Node record {| | |
any value; | |
Node? prev = (); | |
Node? next = (); | |
|}; | |
public type LinkedList record { | |
Node? head; | |
Node? tail; | |
}; |
This file contains hidden or 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
public type AbstractEvictionPolicy abstract object { | |
public function get(LinkedList list, Node node); | |
public function put(LinkedList list, Node node); | |
public function remove(LinkedList list, Node node); | |
public function replace(LinkedList list, Node newNode, Node oldNode); | |
public function clear(LinkedList list); | |
public function evict(LinkedList list) returns Node?; | |
}; |
This file contains hidden or 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
public type AbstractCache abstract object { | |
public function put(string key, any value, int maxAgeInSeconds = -1) returns Error?; | |
public function get(string key) returns any|Error; | |
public function invalidate(string key) returns Error?; | |
public function invalidateAll() returns Error?; | |
public function hasKey(string key) returns boolean; | |
public function keys() returns string[]; | |
public function size() returns int; | |
public function capacity() returns int; | |
}; |
This file contains hidden or 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
name: Deployment | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
This file contains hidden or 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
import ballerina/io; | |
import ballerina/test; | |
Configuration twitterConfig = { | |
consumerKey: "Twitter App Consumer Key", | |
consumerSecret: "Twitter App Consumer Secret", | |
accessToken: "Twitter App Access Token", | |
accessTokenSecret: "Twitter App Access Token Secret", | |
}; | |
Client twitterClient = new(twitterConfig); |
This file contains hidden or 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
import ballerina/encoding; | |
import ballerina/http; | |
# The Twitter client object. | |
public type Client client object { | |
http:Client twitterClient; | |
Credential twitterCredential; | |
public function __init(Configuration twitterConfig) { |
This file contains hidden or 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 main | |
import ( | |
"bytes" | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"golang.org/x/net/http2" | |
"io/ioutil" | |
"log" |
This file contains hidden or 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 main | |
import ( | |
"bytes" | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" |
This file contains hidden or 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 main | |
import ( | |
"fmt" | |
"golang.org/x/net/http2" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |