rest

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

This file contains the REST component that uses grpc-gateway to provide a REST gateway the the ldlm gRPC server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRestServer

func NewRestServer(server grpcLockServer, conf *RestConfig, sConf *sec.SecurityConfig) (*http.Server, func(), error)

NewRestServer creates a new REST server that handles LDLM gRPC requests.

Parameters: - server: The gRPC server that handles LDLM requests. - conf: The configuration for the REST server. - sConf: The security configuration for the REST server.

Returns: - *http.Server: The newly created REST server. - func(): A function to close the server. - error: An error if there was a problem creating the server.

func Run

func Run(server grpcLockServer, conf *RestConfig, sConf *sec.SecurityConfig) (func(), error)

Run starts a REST server that handles LDLM gRPC requests.

Parameters: - server: The gRPC server that handles LDLM requests. - conf: The configuration for the REST server. - sConf: The security configuration for the REST server.

Returns: - A function that can be used to stop the server. - An error if there was a problem starting the server.

Types

type RestConfig

type RestConfig struct {
	RestListenAddress  string        `desc:"Address (host:port) at which the REST server should listen. Set to '' to disable" default:"" short:"r"`
	RestSessionTimeout time.Duration `desc:"REST session idle timeout" default:"10m"`
}

Jump to

Keyboard shortcuts

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