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
| interface Method<T> { | |
| (payload: T): void; | |
| } | |
| interface FakeData { | |
| name: string; | |
| } | |
| class Action { | |
| private static methods: Method<FakeData>[] = []; |
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
| export default class ObjectPool<T> { | |
| private metrics = { | |
| allocated: 0, | |
| free: 0 | |
| }; | |
| private pool: T[] = []; | |
| constructor(private type: new () => T) { } |
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 { Infrastructure } from "@cycleplatform/cycle-api"; | |
| async function listServers() { | |
| const resp = await Infrastructure.Servers.getCollection({ | |
| token: | |
| "secret_S8yL426IlEP2Xq1EzwG9VyBqqqXPfYwt4yA3xXCMRBY4QXO1110KDJIWbkviB", | |
| hubId: "5a8a8f3df231a50001c2317c" | |
| }); | |
| if (!resp.ok) { |
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
| { | |
| "data": [ | |
| { | |
| "id": "5a6b729d8dd3030001exxxxx", | |
| "hostname": "xxxx-packet-sjc1.s.5a6b6f3df231a50001cxxxxx.cycle.io", | |
| "owner": { | |
| "id": "5a662f3bfasdf1a50001acbc1a", | |
| "type": "account" | |
| }, | |
| "hub_id": "5a6basdff231a50001c2317c", |
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
| { | |
| "data": [ | |
| { | |
| "id": "5c98267b4146380001eexxxx", | |
| "hostname": "xxxxx-vultr-sjc.s.5a14ddd8b6393d000197xxxx.cycle.io", | |
| "owner": { | |
| "id": "59dafefe91238b0001baxxxx", | |
| "type": "account" | |
| }, | |
| "hub_id": "5a14ddd8b6393d000197xxxx", |
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 { Infrastructure } from "@cycleplatform/cycle-api"; | |
| async function listServers() { | |
| const resp = await Infrastructure.Servers.getCollection({ | |
| token: | |
| "secret_W8cSxydUl4xPI42bYxG2tx3FGgk81eJolblnZiA3N7ZCY4u7Qx4uI4eaVKkJ", | |
| hubId: "5a14ddd8b6393d0001976f44", | |
| query: { | |
| meta: ["stats"] | |
| }, |