Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CmdGuestbook = &cobra.Command{ Use: "guestbook", Short: "Creates a HTTP server with various endpoints representing a guestbook app", Long: `Starts a HTTP server on the given --http-port (default: 80), serving various endpoints representing a guestbook app. The endpoints and their purpose are: - /register: A guestbook replica will subscribe to a primary, to its given --replicaof endpoint. The primary will then push any updates it receives to its registered replicas through the --backend-port. - /get: Returns '{"data": value}', where the value is the stored value for the given key if non-empty, or the entire store. - /set: Will set the given key-value pair in its own store and propagate it to its replicas, if any. Will return '{"data": "Updated"}' to the caller on success. - /guestbook: Will proxy the request to agnhost-primary if the given cmd is 'set', or agnhost-replica if the given cmd is 'get'.`, Args: cobra.MaximumNArgs(0), Run: main, }
CmdGuestbook is used by agnhost Cobra.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.