litrpc

package
v0.6.7-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SessionType_name = map[int32]string{
		0: "TYPE_MACAROON_READONLY",
		1: "TYPE_MACAROON_ADMIN",
		2: "TYPE_MACAROON_CUSTOM",
		3: "TYPE_UI_PASSWORD",
	}
	SessionType_value = map[string]int32{
		"TYPE_MACAROON_READONLY": 0,
		"TYPE_MACAROON_ADMIN":    1,
		"TYPE_MACAROON_CUSTOM":   2,
		"TYPE_UI_PASSWORD":       3,
	}
)

Enum value maps for SessionType.

View Source
var (
	SessionState_name = map[int32]string{
		0: "STATE_CREATED",
		1: "STATE_IN_USE",
		2: "STATE_REVOKED",
		3: "STATE_EXPIRED",
	}
	SessionState_value = map[string]int32{
		"STATE_CREATED": 0,
		"STATE_IN_USE":  1,
		"STATE_REVOKED": 2,
		"STATE_EXPIRED": 3,
	}
)

Enum value maps for SessionState.

View Source
var File_lit_sessions_proto protoreflect.FileDescriptor
View Source
var Sessions_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "litrpc.Sessions",
	HandlerType: (*SessionsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddSession",
			Handler:    _Sessions_AddSession_Handler,
		},
		{
			MethodName: "ListSessions",
			Handler:    _Sessions_ListSessions_Handler,
		},
		{
			MethodName: "RevokeSession",
			Handler:    _Sessions_RevokeSession_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "lit-sessions.proto",
}

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

Functions

func RegisterSessionsServer

func RegisterSessionsServer(s grpc.ServiceRegistrar, srv SessionsServer)

Types

type AddSessionRequest

type AddSessionRequest struct {
	Label                     string                `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
	SessionType               SessionType           `protobuf:"varint,2,opt,name=session_type,json=sessionType,proto3,enum=litrpc.SessionType" json:"session_type,omitempty"`
	ExpiryTimestampSeconds    uint64                `` /* 130-byte string literal not displayed */
	MailboxServerAddr         string                `protobuf:"bytes,4,opt,name=mailbox_server_addr,json=mailboxServerAddr,proto3" json:"mailbox_server_addr,omitempty"`
	DevServer                 bool                  `protobuf:"varint,5,opt,name=dev_server,json=devServer,proto3" json:"dev_server,omitempty"`
	MacaroonCustomPermissions []*MacaroonPermission `` /* 138-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*AddSessionRequest) Descriptor deprecated

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

Deprecated: Use AddSessionRequest.ProtoReflect.Descriptor instead.

func (*AddSessionRequest) GetDevServer

func (x *AddSessionRequest) GetDevServer() bool

func (*AddSessionRequest) GetExpiryTimestampSeconds

func (x *AddSessionRequest) GetExpiryTimestampSeconds() uint64

func (*AddSessionRequest) GetLabel

func (x *AddSessionRequest) GetLabel() string

func (*AddSessionRequest) GetMacaroonCustomPermissions

func (x *AddSessionRequest) GetMacaroonCustomPermissions() []*MacaroonPermission

func (*AddSessionRequest) GetMailboxServerAddr

func (x *AddSessionRequest) GetMailboxServerAddr() string

func (*AddSessionRequest) GetSessionType

func (x *AddSessionRequest) GetSessionType() SessionType

func (*AddSessionRequest) ProtoMessage

func (*AddSessionRequest) ProtoMessage()

func (*AddSessionRequest) ProtoReflect

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

func (*AddSessionRequest) Reset

func (x *AddSessionRequest) Reset()

func (*AddSessionRequest) String

func (x *AddSessionRequest) String() string

type AddSessionResponse

type AddSessionResponse struct {
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	// contains filtered or unexported fields
}

func (*AddSessionResponse) Descriptor deprecated

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

Deprecated: Use AddSessionResponse.ProtoReflect.Descriptor instead.

func (*AddSessionResponse) GetSession

func (x *AddSessionResponse) GetSession() *Session

func (*AddSessionResponse) ProtoMessage

func (*AddSessionResponse) ProtoMessage()

func (*AddSessionResponse) ProtoReflect

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

func (*AddSessionResponse) Reset

func (x *AddSessionResponse) Reset()

func (*AddSessionResponse) String

func (x *AddSessionResponse) String() string

type ListSessionsRequest

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

func (*ListSessionsRequest) Descriptor deprecated

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

Deprecated: Use ListSessionsRequest.ProtoReflect.Descriptor instead.

func (*ListSessionsRequest) ProtoMessage

func (*ListSessionsRequest) ProtoMessage()

func (*ListSessionsRequest) ProtoReflect

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

func (*ListSessionsRequest) Reset

func (x *ListSessionsRequest) Reset()

func (*ListSessionsRequest) String

func (x *ListSessionsRequest) String() string

type ListSessionsResponse

type ListSessionsResponse struct {
	Sessions []*Session `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"`
	// contains filtered or unexported fields
}

func (*ListSessionsResponse) Descriptor deprecated

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

Deprecated: Use ListSessionsResponse.ProtoReflect.Descriptor instead.

func (*ListSessionsResponse) GetSessions

func (x *ListSessionsResponse) GetSessions() []*Session

func (*ListSessionsResponse) ProtoMessage

func (*ListSessionsResponse) ProtoMessage()

func (*ListSessionsResponse) ProtoReflect

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

func (*ListSessionsResponse) Reset

func (x *ListSessionsResponse) Reset()

func (*ListSessionsResponse) String

func (x *ListSessionsResponse) String() string

type MacaroonPermission

type MacaroonPermission struct {

	// The entity a permission grants access to.
	Entity string `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
	// The action that is granted.
	Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"`
	// contains filtered or unexported fields
}

func (*MacaroonPermission) Descriptor deprecated

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

Deprecated: Use MacaroonPermission.ProtoReflect.Descriptor instead.

func (*MacaroonPermission) GetAction

func (x *MacaroonPermission) GetAction() string

func (*MacaroonPermission) GetEntity

func (x *MacaroonPermission) GetEntity() string

func (*MacaroonPermission) ProtoMessage

func (*MacaroonPermission) ProtoMessage()

func (*MacaroonPermission) ProtoReflect

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

func (*MacaroonPermission) Reset

func (x *MacaroonPermission) Reset()

func (*MacaroonPermission) String

func (x *MacaroonPermission) String() string

type RevokeSessionRequest

type RevokeSessionRequest struct {
	LocalPublicKey []byte `protobuf:"bytes,8,opt,name=local_public_key,json=localPublicKey,proto3" json:"local_public_key,omitempty"`
	// contains filtered or unexported fields
}

func (*RevokeSessionRequest) Descriptor deprecated

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

Deprecated: Use RevokeSessionRequest.ProtoReflect.Descriptor instead.

func (*RevokeSessionRequest) GetLocalPublicKey

func (x *RevokeSessionRequest) GetLocalPublicKey() []byte

func (*RevokeSessionRequest) ProtoMessage

func (*RevokeSessionRequest) ProtoMessage()

func (*RevokeSessionRequest) ProtoReflect

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

func (*RevokeSessionRequest) Reset

func (x *RevokeSessionRequest) Reset()

func (*RevokeSessionRequest) String

func (x *RevokeSessionRequest) String() string

type RevokeSessionResponse

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

func (*RevokeSessionResponse) Descriptor deprecated

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

Deprecated: Use RevokeSessionResponse.ProtoReflect.Descriptor instead.

func (*RevokeSessionResponse) ProtoMessage

func (*RevokeSessionResponse) ProtoMessage()

func (*RevokeSessionResponse) ProtoReflect

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

func (*RevokeSessionResponse) Reset

func (x *RevokeSessionResponse) Reset()

func (*RevokeSessionResponse) String

func (x *RevokeSessionResponse) String() string

type Session

type Session struct {
	Label                  string       `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
	SessionState           SessionState `protobuf:"varint,2,opt,name=session_state,json=sessionState,proto3,enum=litrpc.SessionState" json:"session_state,omitempty"`
	SessionType            SessionType  `protobuf:"varint,3,opt,name=session_type,json=sessionType,proto3,enum=litrpc.SessionType" json:"session_type,omitempty"`
	ExpiryTimestampSeconds uint64       `` /* 130-byte string literal not displayed */
	MailboxServerAddr      string       `protobuf:"bytes,5,opt,name=mailbox_server_addr,json=mailboxServerAddr,proto3" json:"mailbox_server_addr,omitempty"`
	DevServer              bool         `protobuf:"varint,6,opt,name=dev_server,json=devServer,proto3" json:"dev_server,omitempty"`
	PairingSecret          []byte       `protobuf:"bytes,7,opt,name=pairing_secret,json=pairingSecret,proto3" json:"pairing_secret,omitempty"`
	PairingSecretMnemonic  string       `` /* 126-byte string literal not displayed */
	LocalPublicKey         []byte       `protobuf:"bytes,9,opt,name=local_public_key,json=localPublicKey,proto3" json:"local_public_key,omitempty"`
	RemotePublicKey        []byte       `protobuf:"bytes,10,opt,name=remote_public_key,json=remotePublicKey,proto3" json:"remote_public_key,omitempty"`
	// contains filtered or unexported fields
}

func (*Session) Descriptor deprecated

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetDevServer

func (x *Session) GetDevServer() bool

func (*Session) GetExpiryTimestampSeconds

func (x *Session) GetExpiryTimestampSeconds() uint64

func (*Session) GetLabel

func (x *Session) GetLabel() string

func (*Session) GetLocalPublicKey

func (x *Session) GetLocalPublicKey() []byte

func (*Session) GetMailboxServerAddr

func (x *Session) GetMailboxServerAddr() string

func (*Session) GetPairingSecret

func (x *Session) GetPairingSecret() []byte

func (*Session) GetPairingSecretMnemonic

func (x *Session) GetPairingSecretMnemonic() string

func (*Session) GetRemotePublicKey

func (x *Session) GetRemotePublicKey() []byte

func (*Session) GetSessionState

func (x *Session) GetSessionState() SessionState

func (*Session) GetSessionType

func (x *Session) GetSessionType() SessionType

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type SessionState

type SessionState int32
const (
	SessionState_STATE_CREATED SessionState = 0
	SessionState_STATE_IN_USE  SessionState = 1
	SessionState_STATE_REVOKED SessionState = 2
	SessionState_STATE_EXPIRED SessionState = 3
)

func (SessionState) Descriptor

func (SessionState) Enum

func (x SessionState) Enum() *SessionState

func (SessionState) EnumDescriptor deprecated

func (SessionState) EnumDescriptor() ([]byte, []int)

Deprecated: Use SessionState.Descriptor instead.

func (SessionState) Number

func (SessionState) String

func (x SessionState) String() string

func (SessionState) Type

type SessionType

type SessionType int32
const (
	SessionType_TYPE_MACAROON_READONLY SessionType = 0
	SessionType_TYPE_MACAROON_ADMIN    SessionType = 1
	SessionType_TYPE_MACAROON_CUSTOM   SessionType = 2
	SessionType_TYPE_UI_PASSWORD       SessionType = 3
)

func (SessionType) Descriptor

func (SessionType) Enum

func (x SessionType) Enum() *SessionType

func (SessionType) EnumDescriptor deprecated

func (SessionType) EnumDescriptor() ([]byte, []int)

Deprecated: Use SessionType.Descriptor instead.

func (SessionType) Number

func (x SessionType) Number() protoreflect.EnumNumber

func (SessionType) String

func (x SessionType) String() string

func (SessionType) Type

type SessionsClient

type SessionsClient interface {
	AddSession(ctx context.Context, in *AddSessionRequest, opts ...grpc.CallOption) (*AddSessionResponse, error)
	ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error)
	RevokeSession(ctx context.Context, in *RevokeSessionRequest, opts ...grpc.CallOption) (*RevokeSessionResponse, error)
}

SessionsClient is the client API for Sessions 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 NewSessionsClient

func NewSessionsClient(cc grpc.ClientConnInterface) SessionsClient

type SessionsServer

type SessionsServer interface {
	AddSession(context.Context, *AddSessionRequest) (*AddSessionResponse, error)
	ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error)
	RevokeSession(context.Context, *RevokeSessionRequest) (*RevokeSessionResponse, error)
	// contains filtered or unexported methods
}

SessionsServer is the server API for Sessions service. All implementations must embed UnimplementedSessionsServer for forward compatibility

type UnimplementedSessionsServer

type UnimplementedSessionsServer struct {
}

UnimplementedSessionsServer must be embedded to have forward compatible implementations.

func (UnimplementedSessionsServer) AddSession

func (UnimplementedSessionsServer) ListSessions

func (UnimplementedSessionsServer) RevokeSession

type UnsafeSessionsServer

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

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

Jump to

Keyboard shortcuts

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