Documentation ¶
Overview ¶
Author: Paul Côté Last Change Author: Paul Côté Last Date Changed: 2022/09/20
Copyright (C) 2015-2018 Lightning Labs and The Lightning Network Developers ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Author: Paul Côté Last Change Author: Paul Côté Last Date Changed: 2022/09/20
Copyright (C) 2015-2018 Lightning Labs and The Lightning Network Developers ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Author: Paul Côté Last Change Author: Paul Côté Last Date Changed: 2022/09/20
Copyright (C) 2015-2018 Lightning Labs and The Lightning Network Developers ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- func InitLogger(config *Config) (zerolog.Logger, error)
- func Main(interceptor *intercept.Interceptor, server *Server) error
- func MainGrpcServerPermissions() map[string][]bakery.Op
- func NewSubLogger(l *zerolog.Logger, subsystem string) *subLogger
- func StreamingPluginAPIPermission() map[string][]bakery.Op
- type Config
- type RpcServer
- func (s *RpcServer) AddGrpcInterceptor(i *intercept.GrpcInterceptor)
- func (s *RpcServer) AddMacaroonService(svc *macaroons.Service)
- func (s *RpcServer) AdminTest(_ context.Context, _ *lanirpc.AdminTestRequest) (*lanirpc.AdminTestResponse, error)
- func (s *RpcServer) BakeMacaroon(ctx context.Context, req *lanirpc.BakeMacaroonRequest) (*lanirpc.BakeMacaroonResponse, error)
- func (s *RpcServer) InsertROIMarker(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) LoadTestPlan(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) Ping(ctx context.Context) error
- func (s *RpcServer) RegisterWithGrpcServer(grpcServer *grpc.Server) error
- func (s *RpcServer) RegisterWithRestProxy(ctx context.Context, mux *proxy.ServeMux, restDialOpts []grpc.DialOption, ...) error
- func (s *RpcServer) SetPressure(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) SetTemperature(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) Start() error
- func (s *RpcServer) StartRecording(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) StartTestPlan(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) Stop() error
- func (s *RpcServer) StopDaemon(_ context.Context, _ *lanirpc.StopRequest) (*lanirpc.StopResponse, error)
- func (s *RpcServer) StopRecording(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) StopTestPlan(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) SubscribeDataStream(ctx context.Context, _ *proto.Empty) (*proto.Empty, error)
- func (s *RpcServer) TestCommand(_ context.Context, _ *lanirpc.TestRequest) (*lanirpc.TestResponse, error)
- type Server
Constants ¶
const ( ErrGRPCMiddlewareNil = bg.Error("gRPC middleware uninitialized") ErrEmptyPermissionsList = bg.Error("empty permissions list") ErrInvalidMacEntity = bg.Error("invalid macaroon permission entity") ErrInvalidMacAction = bg.Error("invalid macaroon permission action") ErrDeprecatedAction = bg.Error("deprecated rpc command") )
const (
ErrLogLvlNotFound = bg.Error("log level not found")
)
const (
ErrShutdown = bg.Error("shutting down")
)
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
InitLogger creates a new instance of the `zerolog.Logger` type. If `console_out` is true, it will output the logs to the console as well as the logfile
func Main ¶
func Main(interceptor *intercept.Interceptor, server *Server) error
Main is the true entry point for Laniakea. It's called in a nested manner for proper defer execution
func MainGrpcServerPermissions ¶
MainGrpcServerPermissions returns a map of the command URI and it's associated permissions
func NewSubLogger ¶
NewSubLogger takes a `zerolog.Logger` and string for the name of the subsystem and creates a `subLogger` for this subsystem
func StreamingPluginAPIPermission ¶
StreamingPluginAPIPermissions returns a map of the command URI and it's assocaited permissions for the streaming Plugin API methods
Types ¶
type Config ¶
type Config struct { DefaultLogDir bool `yaml:"DefaultLogDir"` LogFileDir string `yaml:"LogFileDir" long:"logfiledir" description:"Choose the directory where the log file is stored"` MaxLogFiles int64 `yaml:"MaxLogFiles" long:"maxlogfiles" description:"Maximum number of logfiles in the log rotation (0 for no rotation)"` MaxLogFileSize int64 `yaml:"MaxLogFileSize" long:"maxlogfilesize" description:"Maximum size of a logfile in MB"` ConsoleOutput bool `yaml:"ConsoleOutput" long:"consoleoutput" description:"Whether log information is printed to the console"` GrpcPort int64 `yaml:"GrpcPort" long:"grpc_port" description:"The port where Laniakea listens for gRPC API requests"` RestPort int64 `yaml:"RestPort" long:"rest_port" description:"The port where Laniakea listens for REST API requests"` ExtraIPAddr []string `yaml:"ExtraIPAddr" long:"tlsextraip" description:"Adds an extra ip to the generated certificate"` // optional parameter PluginDir string `` /* 135-byte string literal not displayed */ Plugins []*lanirpc.PluginConfig `yaml:"Plugins"` RegenerateMacaroons bool `long:"regenmacaroons" description:"Boolean to determine whether macaroons are regenerated"` MacaroonDBPath string TLSCertPath string TLSKeyPath string AdminMacPath string TestMacPath string WSPingInterval time.Duration WSPongWait time.Duration }
Config is the object which will hold all of the config parameters
func InitConfig ¶
InitConfig returns the `Config` struct with either default values or values specified in `config.yaml`
type RpcServer ¶
type RpcServer struct { Active int32 lanirpc.UnimplementedLaniServer SubLogger *zerolog.Logger Listener net.Listener // contains filtered or unexported fields }
RpcServer is a child of the lanirpc.UnimplementedLaniServer struct. Meant to host all related attributes to the rpcserver
func NewRpcServer ¶
func NewRpcServer(interceptor *intercept.Interceptor, config *Config, log *zerolog.Logger) (*RpcServer, error)
NewRpcServer creates an instance of the GrpcServer struct
func (*RpcServer) AddGrpcInterceptor ¶
func (s *RpcServer) AddGrpcInterceptor(i *intercept.GrpcInterceptor)
AddGrpcInterceptor adds the grpc middleware to the RpcServer
func (*RpcServer) AddMacaroonService ¶
AddMacaroonService adds the macaroon service to the attributes of the RpcServer
func (*RpcServer) AdminTest ¶
func (s *RpcServer) AdminTest(_ context.Context, _ *lanirpc.AdminTestRequest) (*lanirpc.AdminTestResponse, error)
AdminTest will return a string only if the client has the admin macaroon
func (*RpcServer) BakeMacaroon ¶
func (s *RpcServer) BakeMacaroon(ctx context.Context, req *lanirpc.BakeMacaroonRequest) (*lanirpc.BakeMacaroonResponse, error)
BakeMacaroon bakes a new macaroon based on input permissions and constraints
func (*RpcServer) InsertROIMarker ¶
InsertROIMarker is a deprecated Executor API rpc command
func (*RpcServer) LoadTestPlan ¶
LoadTestPlan is a deprecated Executor API rpc command
func (*RpcServer) Ping ¶
Ping implements the health package RegisteredHealthService interface TODO:SSSOCPaulCote - This should do more, it should actually probe the service to make sure everything is operating nominally
func (*RpcServer) RegisterWithGrpcServer ¶
RegisterWithGrpcServer registers the rpcServer with the root gRPC server.
func (*RpcServer) RegisterWithRestProxy ¶
func (s *RpcServer) RegisterWithRestProxy(ctx context.Context, mux *proxy.ServeMux, restDialOpts []grpc.DialOption, restProxyDest string) error
RegisterWithRestProxy registers the RPC Server with the REST proxy
func (*RpcServer) SetPressure ¶
SetPressure is a deprecated Controller API rpc command
func (*RpcServer) SetTemperature ¶
SetTemperature is a deprecated Controller API rpc command
func (*RpcServer) StartRecording ¶
StartRecording is a deprecated DataCollector API rpc command
func (*RpcServer) StartTestPlan ¶
StartTestPlan is a deprecated Executor API rpc command
func (*RpcServer) StopDaemon ¶
func (s *RpcServer) StopDaemon(_ context.Context, _ *lanirpc.StopRequest) (*lanirpc.StopResponse, error)
StopDaemon will send a shutdown request to the interrupt handler, triggering a graceful shutdown
func (*RpcServer) StopRecording ¶
StopRecording is a deprecated DataCollector API rpc command
func (*RpcServer) StopTestPlan ¶
StopTestPlan is a deprecated Executor API rpc command
func (*RpcServer) SubscribeDataStream ¶
SubscribeDataStream is a deprecated DataCollector API rpc command
func (*RpcServer) TestCommand ¶
func (s *RpcServer) TestCommand(_ context.Context, _ *lanirpc.TestRequest) (*lanirpc.TestResponse, error)
TestCommand will return a string for any macaroon
type Server ¶
type Server struct { Active int32 // atomic // contains filtered or unexported fields }
Server is the object representing the state of the server
func InitServer ¶
InitServer creates a new instance of the server and returns a pointer to it