server

package
v1.1.1035 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VersionTag string
	CommitHash string
	BuildDate  string
)

The following variables are set by -ldflags at build time.

Functions

func Concurrency added in v1.0.320

func Concurrency(n int) concurrencyOption

Concurrency specifies the number of threads for each of SHAR's queue listeneres.

func EphemeralStorage added in v0.1.73

func EphemeralStorage() ephemeralStorageOption

EphemeralStorage instructs SHAR to use memory rather than disk for storage. This is not recommended for production use.

func GrpcPort added in v1.0.623

func GrpcPort(port int) grpcPortOption

GrpcPort specifies the port healthcheck is listening on

func NatsConn added in v1.1.754

func NatsConn(conn *nats.Conn) natsConnOption

NatsConn specifies the nats Conn to use

func NatsUrl added in v1.0.623

func NatsUrl(url string) natsUrlOption

NatsUrl specifies the nats URL to connect to

func PanicRecovery added in v0.1.171

func PanicRecovery(enabled bool) panicOption

PanicRecovery enables or disables SHAR's ability to recover from server panics. This is on by default, and disabling it is not recommended for production use.

func PreventOrphanServiceTasks added in v1.0.230

func PreventOrphanServiceTasks() orphanTaskOption

PreventOrphanServiceTasks enables or disables SHAR's validation of service task names againt existing workflows.

func WithApiAuthorizer added in v1.0.362

func WithApiAuthorizer(authFn authz.APIFunc) apiAuthorizerOption

WithApiAuthorizer specifies a handler function for API authorization.

func WithAuthentication added in v1.0.362

func WithAuthentication(authFn authn.Check) authenticationOption

WithAuthentication specifies a handler function for API authorization.

func WithNoHealthServer added in v1.0.427

func WithNoHealthServer() noHealthServerOption

WithNoHealthServer specifies a handler function for API authorization.

func WithSharVersion added in v1.0.514

func WithSharVersion(version *version2.Version) sharVersionOption

WithSharVersion instructs SHAR to claim it is a specific version. This is highly inadvisable as datalos may occur.

func WithTelemetryEndpoint added in v1.1.848

func WithTelemetryEndpoint(endpoint string) telemetryEndpointOption

WithTelemetryEndpoint specifies a handler function for API authorization.

Types

type Option added in v0.1.86

type Option interface {
	// contains filtered or unexported methods
}

Option represents a SHAR server option

type Server

type Server struct {
	SharVersion *version.Version
	// contains filtered or unexported fields
}

Server is the shar server type responsible for hosting the SHAR API.

func New

func New(options ...Option) *Server

New creates a new SHAR server. Leave the exporter nil if telemetry is not required

func (*Server) Details added in v1.1.949

func (s *Server) Details()

Details prints the details to stdout of the current SHAR server.

func (*Server) GetEndPoint added in v1.0.623

func (s *Server) GetEndPoint() string

GetEndPoint will return the URL of the GRPC health endpoint for the shar server

func (*Server) Listen

func (s *Server) Listen()

Listen starts the GRPC server for both serving requests, and the GRPC health endpoint.

func (*Server) Ready added in v0.1.66

func (s *Server) Ready() bool

Ready returns true if the SHAR server is servicing API calls.

func (*Server) Shutdown added in v0.1.66

func (s *Server) Shutdown()

Shutdown gracefully shuts down the GRPC server, and requests that

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL