Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Establish a websocket connection between the client and the Ranvier server. Whenever the Ranvier server detects // changes to the configuration you care about (specified in the options), it will notify your client and update its // state. If the connection could not be made, an error is returned. Connect(options *ConnOptions) (*Connection, error) // Sever the connection between the client and the Ranvier server. The client will no longer receive updates from the // Ranvier server after the connection is disconnected. Disconnect(conn *Connection) // Query Ranvier for some config. The query is a valid jsonpath query (https://restfulapi.net/json-jsonpath/). If the // query is unable to find any config, nil is returned. If the query is invalid, an error is returned. // // All queries are cached within the client and will be hit unless specified in the options. The order of operations // for retrieving a query are // client cache -> Ranvier server -> local disk // If the query is unsuccessful in all of these operations, nil is returned. // // All successful queries will be written to disk. Query(options *QueryOptions) (*model.Config, error) }
func NewClient ¶
func NewClient(options *ClientOptions) (Client, error)
Create a new Ranvier client with the provided options. It is advised to only use a single client as all queries made by the client are cached.
type ClientOptions ¶
type ClientOptions struct { // The required hostname to your Ranvier server(s). Should not include the protocol, e.g. if Ranvier is pointed at the // url https://ranvier.mycompany.com, this hostname should strictly be ranvier.mycompany.com. Or if it's // https://ranvier:8080, this field should be set to ranvier:8080. Hostname string // The directory that your local config files will be stored on disk. Config is stored on disk to prevent a strong // reliance on the server. This directory will default to a temp directory. ConfigDirectory string }
type ConnOptions ¶
type ConnOptions struct { // The names of the configuration files that you want updates for. Whenever the configuration tied to this name is // updated, the Connection will receive a message of the new configuration. Names []string // The amount of time to wait between connection retries if the websocket were to disconnect. Defaults to 30 seconds. RetryInterval time.Duration }
type Connection ¶
type Connection struct { // The channel for all incoming configuration changes. Listen for messages on this channel to get realtime updates on // configuration changes. OnUpdate chan model.ConfigEvent // contains filtered or unexported fields }
type IntegrationSuite ¶
type IntegrationSuite struct { suite.Suite Hostname string Port string Host string Resource *dockertest.Resource Pool *dockertest.Pool }
func (*IntegrationSuite) SetupSuite ¶
func (i *IntegrationSuite) SetupSuite()
func (*IntegrationSuite) TearDownSuite ¶
func (i *IntegrationSuite) TearDownSuite()
type QueryOptions ¶
Click to show internal directories.
Click to hide internal directories.