Documentation ¶
Overview ¶
Package SDK provides a simple wrapper for gRPC's Dial function. It arranges for the application's API key to be sent with each RPC, that TLS is used, the setting of the appropriate connection endpoint and server name, and the configuration of any other parameters that are deemed necessary to work well with the nsys.io server complex and services.
Index ¶
Constants ¶
const ( // Endpoint for host TLS connections EndpointDefault = "api.nsys.io:39111" EndpointKey = "NSYS_ENDPOINT" // The TLS server we expect to find there. ServerNameDefault = "api.nsys.io" ServerNameKey = "NSYS_SERVER_NAME" // API Key environmental var ApiKeyKey = "NSYS_API_KEY" // Maximum message size over gRPC MaxMessageSize = 200 * 1024 * 1024 )
Variables ¶
var ( // These may be set prior to calling NewConn. // Environmental variables override anything set here except for ApiKey. Endpoint = EndpointDefault ServerName = ServerNameDefault ApiKey string )
Functions ¶
func New ¶
New returns a grpc.ClientConn instance after having performed a grpc.Dial to the nsys.io host complex with options set such TLS is used, a connection-specific API key (aka ticket) is supplied with every RPC, and so on. Supplied dial options are added to the base set. Parameters not set in the input structure are set to package default values (or those zapped into the package's public globals) with those defaults being overridden by anything found in the environment.
func NewConn ¶
func NewConn(ctx context.Context, xopts ...grpc.DialOption) (*grpc.ClientConn, error)
NewConn is a legacy function which is now a simple wrapper on New(). It is only appropriate for use when the application is using a single API key.