gen

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package gen is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Config_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "configs.Config",
	HandlerType: (*ConfigServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetLightningConfig",
			Handler:    _Config_GetLightningConfig_Handler,
		},
		{
			MethodName: "SaveLightningConfig",
			Handler:    _Config_SaveLightningConfig_Handler,
		},
		{
			MethodName: "GetIONConfig",
			Handler:    _Config_GetIONConfig_Handler,
		},
		{
			MethodName: "SaveIONConfig",
			Handler:    _Config_SaveIONConfig_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/imp/api/config/config.proto",
}

Config_ServiceDesc is the grpc.ServiceDesc for Config service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_proto_imp_api_config_config_proto protoreflect.FileDescriptor

Functions

func RegisterConfigHandler

func RegisterConfigHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterConfigHandler registers the http handlers for service Config to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterConfigHandlerClient

func RegisterConfigHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConfigClient) error

RegisterConfigHandlerClient registers the http handlers for service Config to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ConfigClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ConfigClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ConfigClient" to call the correct interceptors.

func RegisterConfigHandlerFromEndpoint

func RegisterConfigHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterConfigHandlerFromEndpoint is same as RegisterConfigHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterConfigHandlerServer

func RegisterConfigHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigServer) error

RegisterConfigHandlerServer registers the http handlers for service Config to "mux". UnaryRPC :call ConfigServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterConfigHandlerFromEndpoint instead.

func RegisterConfigServer

func RegisterConfigServer(s grpc.ServiceRegistrar, srv ConfigServer)

Types

type ConfigClient

type ConfigClient interface {
	//*
	// GetLightningConfig gets the lightning configs for the daemon.
	GetLightningConfig(ctx context.Context, in *GetLightningConfigRequest, opts ...grpc.CallOption) (*GetLightningConfigResponse, error)
	//*
	// SaveLightningConfig save the lightning config and restart the daemon.
	SaveLightningConfig(ctx context.Context, in *SaveLightningConfigRequest, opts ...grpc.CallOption) (*SaveLightningConfigResponse, error)
	//*
	// GetIONConfig gets the ion configs for the daemon.
	GetIONConfig(ctx context.Context, in *GetIONConfigRequest, opts ...grpc.CallOption) (*GetIONConfigResponse, error)
	//*
	// SaveIONConfig will save the ion config and restart the daemon.
	SaveIONConfig(ctx context.Context, in *SaveIONConfigRequest, opts ...grpc.CallOption) (*SaveIONConfigResponse, error)
}

ConfigClient is the client API for Config service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewConfigClient

func NewConfigClient(cc grpc.ClientConnInterface) ConfigClient

type ConfigServer

type ConfigServer interface {
	//*
	// GetLightningConfig gets the lightning configs for the daemon.
	GetLightningConfig(context.Context, *GetLightningConfigRequest) (*GetLightningConfigResponse, error)
	//*
	// SaveLightningConfig save the lightning config and restart the daemon.
	SaveLightningConfig(context.Context, *SaveLightningConfigRequest) (*SaveLightningConfigResponse, error)
	//*
	// GetIONConfig gets the ion configs for the daemon.
	GetIONConfig(context.Context, *GetIONConfigRequest) (*GetIONConfigResponse, error)
	//*
	// SaveIONConfig will save the ion config and restart the daemon.
	SaveIONConfig(context.Context, *SaveIONConfigRequest) (*SaveIONConfigResponse, error)
	// contains filtered or unexported methods
}

ConfigServer is the server API for Config service. All implementations must embed UnimplementedConfigServer for forward compatibility

type GetIONConfigRequest

type GetIONConfigRequest struct {
	// contains filtered or unexported fields
}

* Represents a request to get the ion config.

func (*GetIONConfigRequest) Descriptor deprecated

func (*GetIONConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetIONConfigRequest.ProtoReflect.Descriptor instead.

func (*GetIONConfigRequest) ProtoMessage

func (*GetIONConfigRequest) ProtoMessage()

func (*GetIONConfigRequest) ProtoReflect

func (x *GetIONConfigRequest) ProtoReflect() protoreflect.Message

func (*GetIONConfigRequest) Reset

func (x *GetIONConfigRequest) Reset()

func (*GetIONConfigRequest) String

func (x *GetIONConfigRequest) String() string

type GetIONConfigResponse

type GetIONConfigResponse struct {
	IonConfig *IONConfig `protobuf:"bytes,1,opt,name=ion_config,json=ionConfig,proto3" json:"ion_config,omitempty"` // The ion config
	// contains filtered or unexported fields
}

* Represents a response containing the ion config.

func (*GetIONConfigResponse) Descriptor deprecated

func (*GetIONConfigResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetIONConfigResponse.ProtoReflect.Descriptor instead.

func (*GetIONConfigResponse) GetIonConfig

func (x *GetIONConfigResponse) GetIonConfig() *IONConfig

func (*GetIONConfigResponse) ProtoMessage

func (*GetIONConfigResponse) ProtoMessage()

func (*GetIONConfigResponse) ProtoReflect

func (x *GetIONConfigResponse) ProtoReflect() protoreflect.Message

func (*GetIONConfigResponse) Reset

func (x *GetIONConfigResponse) Reset()

func (*GetIONConfigResponse) String

func (x *GetIONConfigResponse) String() string

type GetLightningConfigRequest

type GetLightningConfigRequest struct {
	// contains filtered or unexported fields
}

* Represents a request to get the lightning config.

func (*GetLightningConfigRequest) Descriptor deprecated

func (*GetLightningConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetLightningConfigRequest.ProtoReflect.Descriptor instead.

func (*GetLightningConfigRequest) ProtoMessage

func (*GetLightningConfigRequest) ProtoMessage()

func (*GetLightningConfigRequest) ProtoReflect

func (*GetLightningConfigRequest) Reset

func (x *GetLightningConfigRequest) Reset()

func (*GetLightningConfigRequest) String

func (x *GetLightningConfigRequest) String() string

type GetLightningConfigResponse

type GetLightningConfigResponse struct {
	LightningConfig *LightningConfig `protobuf:"bytes,1,opt,name=lightning_config,json=lightningConfig,proto3" json:"lightning_config,omitempty"` // The lightning config
	// contains filtered or unexported fields
}

* Represents a response containing the lightning config.

func (*GetLightningConfigResponse) Descriptor deprecated

func (*GetLightningConfigResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetLightningConfigResponse.ProtoReflect.Descriptor instead.

func (*GetLightningConfigResponse) GetLightningConfig

func (x *GetLightningConfigResponse) GetLightningConfig() *LightningConfig

func (*GetLightningConfigResponse) ProtoMessage

func (*GetLightningConfigResponse) ProtoMessage()

func (*GetLightningConfigResponse) ProtoReflect

func (*GetLightningConfigResponse) Reset

func (x *GetLightningConfigResponse) Reset()

func (*GetLightningConfigResponse) String

func (x *GetLightningConfigResponse) String() string

type IONConfig

type IONConfig struct {
	Url    string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`        // the lightning IP address
	Active bool   `protobuf:"varint,2,opt,name=active,proto3" json:"active,omitempty"` // the lightning admin macaroon
	// contains filtered or unexported fields
}

func (*IONConfig) Descriptor deprecated

func (*IONConfig) Descriptor() ([]byte, []int)

Deprecated: Use IONConfig.ProtoReflect.Descriptor instead.

func (*IONConfig) GetActive

func (x *IONConfig) GetActive() bool

func (*IONConfig) GetUrl

func (x *IONConfig) GetUrl() string

func (*IONConfig) ProtoMessage

func (*IONConfig) ProtoMessage()

func (*IONConfig) ProtoReflect

func (x *IONConfig) ProtoReflect() protoreflect.Message

func (*IONConfig) Reset

func (x *IONConfig) Reset()

func (*IONConfig) String

func (x *IONConfig) String() string

type LightningConfig

type LightningConfig struct {
	Ip               string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`                                                       // the lightning IP address
	Port             string `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"`                                                   // the lightning IP port
	Pubkey           string `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"`                                               // the lightning pubkey
	TlsCert          string `protobuf:"bytes,4,opt,name=tls_cert,json=tlsCert,proto3" json:"tls_cert,omitempty"`                              // the lightning tls cert
	AdminMacaroon    string `protobuf:"bytes,5,opt,name=admin_macaroon,json=adminMacaroon,proto3" json:"admin_macaroon,omitempty"`            // the lightning admin macaroon file
	Listening        bool   `protobuf:"varint,6,opt,name=listening,proto3" json:"listening,omitempty"`                                        // the lightning admin macaroon file
	TlsCertHex       string `protobuf:"bytes,7,opt,name=tls_cert_hex,json=tlsCertHex,proto3" json:"tls_cert_hex,omitempty"`                   // the lightning tls cert hex instead of file
	AdminMacaroonHex string `protobuf:"bytes,8,opt,name=admin_macaroon_hex,json=adminMacaroonHex,proto3" json:"admin_macaroon_hex,omitempty"` // the lightning admin macaroon hex instead of file
	// contains filtered or unexported fields
}

func (*LightningConfig) Descriptor deprecated

func (*LightningConfig) Descriptor() ([]byte, []int)

Deprecated: Use LightningConfig.ProtoReflect.Descriptor instead.

func (*LightningConfig) GetAdminMacaroon

func (x *LightningConfig) GetAdminMacaroon() string

func (*LightningConfig) GetAdminMacaroonHex

func (x *LightningConfig) GetAdminMacaroonHex() string

func (*LightningConfig) GetIp

func (x *LightningConfig) GetIp() string

func (*LightningConfig) GetListening

func (x *LightningConfig) GetListening() bool

func (*LightningConfig) GetPort

func (x *LightningConfig) GetPort() string

func (*LightningConfig) GetPubkey

func (x *LightningConfig) GetPubkey() string

func (*LightningConfig) GetTlsCert

func (x *LightningConfig) GetTlsCert() string

func (*LightningConfig) GetTlsCertHex

func (x *LightningConfig) GetTlsCertHex() string

func (*LightningConfig) ProtoMessage

func (*LightningConfig) ProtoMessage()

func (*LightningConfig) ProtoReflect

func (x *LightningConfig) ProtoReflect() protoreflect.Message

func (*LightningConfig) Reset

func (x *LightningConfig) Reset()

func (*LightningConfig) String

func (x *LightningConfig) String() string

type SaveIONConfigRequest

type SaveIONConfigRequest struct {
	IonConfig *IONConfig `protobuf:"bytes,1,opt,name=ion_config,json=ionConfig,proto3" json:"ion_config,omitempty"` // The ion config
	// contains filtered or unexported fields
}

* Represents a request to save the ion config.

func (*SaveIONConfigRequest) Descriptor deprecated

func (*SaveIONConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use SaveIONConfigRequest.ProtoReflect.Descriptor instead.

func (*SaveIONConfigRequest) GetIonConfig

func (x *SaveIONConfigRequest) GetIonConfig() *IONConfig

func (*SaveIONConfigRequest) ProtoMessage

func (*SaveIONConfigRequest) ProtoMessage()

func (*SaveIONConfigRequest) ProtoReflect

func (x *SaveIONConfigRequest) ProtoReflect() protoreflect.Message

func (*SaveIONConfigRequest) Reset

func (x *SaveIONConfigRequest) Reset()

func (*SaveIONConfigRequest) String

func (x *SaveIONConfigRequest) String() string

type SaveIONConfigResponse

type SaveIONConfigResponse struct {
	// contains filtered or unexported fields
}

* Represents a response containing the ion save config results.

func (*SaveIONConfigResponse) Descriptor deprecated

func (*SaveIONConfigResponse) Descriptor() ([]byte, []int)

Deprecated: Use SaveIONConfigResponse.ProtoReflect.Descriptor instead.

func (*SaveIONConfigResponse) ProtoMessage

func (*SaveIONConfigResponse) ProtoMessage()

func (*SaveIONConfigResponse) ProtoReflect

func (x *SaveIONConfigResponse) ProtoReflect() protoreflect.Message

func (*SaveIONConfigResponse) Reset

func (x *SaveIONConfigResponse) Reset()

func (*SaveIONConfigResponse) String

func (x *SaveIONConfigResponse) String() string

type SaveLightningConfigRequest

type SaveLightningConfigRequest struct {
	LightningConfig *LightningConfig `protobuf:"bytes,1,opt,name=lightning_config,json=lightningConfig,proto3" json:"lightning_config,omitempty"` // The lightning config
	// contains filtered or unexported fields
}

* Represents a request to save the lightning config.

func (*SaveLightningConfigRequest) Descriptor deprecated

func (*SaveLightningConfigRequest) Descriptor() ([]byte, []int)

Deprecated: Use SaveLightningConfigRequest.ProtoReflect.Descriptor instead.

func (*SaveLightningConfigRequest) GetLightningConfig

func (x *SaveLightningConfigRequest) GetLightningConfig() *LightningConfig

func (*SaveLightningConfigRequest) ProtoMessage

func (*SaveLightningConfigRequest) ProtoMessage()

func (*SaveLightningConfigRequest) ProtoReflect

func (*SaveLightningConfigRequest) Reset

func (x *SaveLightningConfigRequest) Reset()

func (*SaveLightningConfigRequest) String

func (x *SaveLightningConfigRequest) String() string

type SaveLightningConfigResponse

type SaveLightningConfigResponse struct {
	// contains filtered or unexported fields
}

* Represents a response containing the lightning save config results.

func (*SaveLightningConfigResponse) Descriptor deprecated

func (*SaveLightningConfigResponse) Descriptor() ([]byte, []int)

Deprecated: Use SaveLightningConfigResponse.ProtoReflect.Descriptor instead.

func (*SaveLightningConfigResponse) ProtoMessage

func (*SaveLightningConfigResponse) ProtoMessage()

func (*SaveLightningConfigResponse) ProtoReflect

func (*SaveLightningConfigResponse) Reset

func (x *SaveLightningConfigResponse) Reset()

func (*SaveLightningConfigResponse) String

func (x *SaveLightningConfigResponse) String() string

type UnimplementedConfigServer

type UnimplementedConfigServer struct {
}

UnimplementedConfigServer must be embedded to have forward compatible implementations.

func (UnimplementedConfigServer) GetIONConfig

func (UnimplementedConfigServer) SaveIONConfig

type UnsafeConfigServer added in v1.0.5

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

UnsafeConfigServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ConfigServer will result in compilation errors.

Jump to

Keyboard shortcuts

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