package
0.16.1
Repository: https://github.com/ssh2go/atlas-app-toolkit.git
Documentation: pkg.go.dev

# README

Server

Server Wrapper

You can package your gRPC server along with your REST gateway, health checks and any other http endpoints using server.NewServer:

s, err := server.NewServer(
    server.WithGrpcServer(grpcServer),
    server.WithHealthChecks(healthChecks),
    server.WithGateway(
        gateway.WithEndpointRegistration("/v1/", server_test.RegisterHelloHandlerFromEndpoint),
        gateway.WithServerAddress(grpcL.Addr().String()),
    ),
)
if err != nil {
    log.Fatal(err)
}
// serve it by passing in net.Listeners for the respective servers
if err := s.Serve(grpcListener, httpListener); err != nil {
    log.Fatal(err)
}

You can see a full example here.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
NewServer creates a Server from the given options.
NewTLSClientConfig returns a TLS config for a client connection If caPath is empty, system CAs will be used.
NewTLSConfig returns a TLS config that includes a certificate Use for Server TLS config or when using a client certificate If caPath is empty, system CAs will be used.
No description provided by the author
WithGateway registers the given gateway options with this server.
WithGrpcServer adds the given GRPC server to this server.
WithHandler registers the given http handler to this server by registering the pattern at the root of the http server.
WithHealthChecks registers the given health checker with this server by registering its endpoints at the root of the http server.
WithInitializer adds an initialization function that will get called prior to serving.
WithInitializerTimeout set the duration initialization will wait before halting and returning an error.

# Variables

DefaultInitializerTimeout is the reasonable default amount of time one would expect initialization to take in the worst case.
ErrInitializeTimeout is returned when an InitializerFunc takes too long to finish during Server.Serve.

# Structs

No description provided by the author
No description provided by the author
Server is a wrapper struct that will allow you to stand up your GPRC server, API Gateway and health checks within the same struct.
No description provided by the author

# Type aliases

InitializerFunc is a handler that can be passed into WithInitializer to be executed prior to serving.
Option is a functional option for creating a Server.