gen

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 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 File_proto_imp_api_key_key_proto protoreflect.FileDescriptor

Functions

func RegisterKeyHandler

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

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

func RegisterKeyHandlerClient

func RegisterKeyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client KeyClient) error

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

func RegisterKeyHandlerFromEndpoint

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

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

func RegisterKeyHandlerServer

func RegisterKeyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server KeyServer) error

RegisterKeyHandlerServer registers the http handlers for service Key to "mux". UnaryRPC :call KeyServer 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 RegisterKeyHandlerFromEndpoint instead.

func RegisterKeyServer

func RegisterKeyServer(s *grpc.Server, srv KeyServer)

Types

type InitSeedRequest

type InitSeedRequest struct {
	Mnenomic   string `protobuf:"bytes,1,opt,name=mnenomic,proto3" json:"mnenomic,omitempty"`     // The optional mnenomic to set if you already have a seed you want to use with this daemon
	Passphrase string `protobuf:"bytes,2,opt,name=passphrase,proto3" json:"passphrase,omitempty"` // The passphrase to encrypt the mnenomic, necessary for unlocking the daemon on restarts
	// contains filtered or unexported fields
}

* Represents an init seed request to initialize the master seed.

func (*InitSeedRequest) Descriptor deprecated

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

Deprecated: Use InitSeedRequest.ProtoReflect.Descriptor instead.

func (*InitSeedRequest) GetMnenomic

func (x *InitSeedRequest) GetMnenomic() string

func (*InitSeedRequest) GetPassphrase

func (x *InitSeedRequest) GetPassphrase() string

func (*InitSeedRequest) ProtoMessage

func (*InitSeedRequest) ProtoMessage()

func (*InitSeedRequest) ProtoReflect

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

func (*InitSeedRequest) Reset

func (x *InitSeedRequest) Reset()

func (*InitSeedRequest) String

func (x *InitSeedRequest) String() string

type InitSeedResponse

type InitSeedResponse struct {
	Mnenomic string `protobuf:"bytes,1,opt,name=mnenomic,proto3" json:"mnenomic,omitempty"`           // The mnenomic that the seed was generated from, should be the same if one was passed in
	ApiKey   string `protobuf:"bytes,2,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` // The api key for the user to send authenticated requests
	// contains filtered or unexported fields
}

* Represents a response back from an init seed request.

func (*InitSeedResponse) Descriptor deprecated

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

Deprecated: Use InitSeedResponse.ProtoReflect.Descriptor instead.

func (*InitSeedResponse) GetApiKey

func (x *InitSeedResponse) GetApiKey() string

func (*InitSeedResponse) GetMnenomic

func (x *InitSeedResponse) GetMnenomic() string

func (*InitSeedResponse) ProtoMessage

func (*InitSeedResponse) ProtoMessage()

func (*InitSeedResponse) ProtoReflect

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

func (*InitSeedResponse) Reset

func (x *InitSeedResponse) Reset()

func (*InitSeedResponse) String

func (x *InitSeedResponse) String() string

type KeyClient

type KeyClient interface {
	//*
	// InitSeed initializes the master seed for the daemon, and encrypts using the passphrase.
	InitSeed(ctx context.Context, in *InitSeedRequest, opts ...grpc.CallOption) (*InitSeedResponse, error)
	//*
	// UnlockSeed unlocks the master seed for the daemon, and decrypts using the passphrase.
	UnlockSeed(ctx context.Context, in *UnlockSeedRequest, opts ...grpc.CallOption) (*UnlockSeedResponse, error)
	//*
	// Status gives the status of the daemon db/key.
	Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
}

KeyClient is the client API for Key service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewKeyClient

func NewKeyClient(cc grpc.ClientConnInterface) KeyClient

type KeyServer

type KeyServer interface {
	//*
	// InitSeed initializes the master seed for the daemon, and encrypts using the passphrase.
	InitSeed(context.Context, *InitSeedRequest) (*InitSeedResponse, error)
	//*
	// UnlockSeed unlocks the master seed for the daemon, and decrypts using the passphrase.
	UnlockSeed(context.Context, *UnlockSeedRequest) (*UnlockSeedResponse, error)
	//*
	// Status gives the status of the daemon db/key.
	Status(context.Context, *StatusRequest) (*StatusResponse, error)
}

KeyServer is the server API for Key service.

type StatusRequest

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

* Represents an status request message.

func (*StatusRequest) Descriptor deprecated

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

Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.

func (*StatusRequest) ProtoMessage

func (*StatusRequest) ProtoMessage()

func (*StatusRequest) ProtoReflect

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

func (*StatusRequest) Reset

func (x *StatusRequest) Reset()

func (*StatusRequest) String

func (x *StatusRequest) String() string

type StatusResponse

type StatusResponse struct {
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // The status of the daemon db/key. NOT_INITIALIZED means an InitSeed() is needed. LOCKED means an UnlockSeed() is needed. READY means the daemon is ready.
	// contains filtered or unexported fields
}

* Represents a response back from a status request.

func (*StatusResponse) Descriptor deprecated

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

Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.

func (*StatusResponse) GetStatus

func (x *StatusResponse) GetStatus() string

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) ProtoReflect

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

func (*StatusResponse) Reset

func (x *StatusResponse) Reset()

func (*StatusResponse) String

func (x *StatusResponse) String() string

type UnimplementedKeyServer

type UnimplementedKeyServer struct {
}

UnimplementedKeyServer can be embedded to have forward compatible implementations.

func (*UnimplementedKeyServer) InitSeed

func (*UnimplementedKeyServer) Status

func (*UnimplementedKeyServer) UnlockSeed

type UnlockSeedRequest

type UnlockSeedRequest struct {
	Passphrase string `protobuf:"bytes,1,opt,name=passphrase,proto3" json:"passphrase,omitempty"` // The passphrase to decrypt the seed, necessary for unlocking the daemon on restarts
	// contains filtered or unexported fields
}

* Represents an unlock seed request to unlock the master seed.

func (*UnlockSeedRequest) Descriptor deprecated

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

Deprecated: Use UnlockSeedRequest.ProtoReflect.Descriptor instead.

func (*UnlockSeedRequest) GetPassphrase

func (x *UnlockSeedRequest) GetPassphrase() string

func (*UnlockSeedRequest) ProtoMessage

func (*UnlockSeedRequest) ProtoMessage()

func (*UnlockSeedRequest) ProtoReflect

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

func (*UnlockSeedRequest) Reset

func (x *UnlockSeedRequest) Reset()

func (*UnlockSeedRequest) String

func (x *UnlockSeedRequest) String() string

type UnlockSeedResponse

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

* Represents a response back from an unlock seed request.

func (*UnlockSeedResponse) Descriptor deprecated

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

Deprecated: Use UnlockSeedResponse.ProtoReflect.Descriptor instead.

func (*UnlockSeedResponse) ProtoMessage

func (*UnlockSeedResponse) ProtoMessage()

func (*UnlockSeedResponse) ProtoReflect

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

func (*UnlockSeedResponse) Reset

func (x *UnlockSeedResponse) Reset()

func (*UnlockSeedResponse) String

func (x *UnlockSeedResponse) String() string

Jump to

Keyboard shortcuts

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