Documentation ¶
Overview ¶
Package mnemosynerpc
Package mnemosynerpc is a generated protocol buffer package.
It is generated from these files:
mnemosyne.proto
It has these top-level messages:
AccessToken Session GetRequest GetResponse ContextResponse ListRequest ListResponse ExistsRequest ExistsResponse StartRequest StartResponse AbandonRequest AbandonResponse SetValueRequest SetValueResponse DeleteRequest DeleteResponse
Index ¶
- Constants
- func NewAccessTokenContext(ctx context.Context, at AccessToken) context.Context
- func RegisterRPCServer(s *grpc.Server, srv RPCServer)
- type AbandonRequest
- type AbandonResponse
- type AccessToken
- func AccessTokenFromContext(ctx context.Context) (AccessToken, bool)
- func DecodeAccessToken(s []byte) (at AccessToken)
- func DecodeAccessTokenString(s string) AccessToken
- func NewAccessToken(key, hash []byte) AccessToken
- func ParseAccessToken(s string) AccessToken
- func RandomAccessToken(key []byte) (at AccessToken, err error)
- func (at AccessToken) Bytes() []byte
- func (*AccessToken) Descriptor() ([]byte, []int)
- func (at AccessToken) Encode() string
- func (at AccessToken) IsEmpty() bool
- func (*AccessToken) ProtoMessage()
- func (m *AccessToken) Reset()
- func (at *AccessToken) Scan(src interface{}) error
- func (m *AccessToken) String() string
- func (at AccessToken) Value() (driver.Value, error)
- type ContextResponse
- type DeleteRequest
- func (*DeleteRequest) Descriptor() ([]byte, []int)
- func (m *DeleteRequest) GetAccessToken() *AccessToken
- func (m *DeleteRequest) GetExpireAtFrom() *google_protobuf.Timestamp
- func (m *DeleteRequest) GetExpireAtTo() *google_protobuf.Timestamp
- func (*DeleteRequest) ProtoMessage()
- func (m *DeleteRequest) Reset()
- func (m *DeleteRequest) String() string
- type DeleteResponse
- type ExistsRequest
- type ExistsResponse
- type GetRequest
- type GetResponse
- type ListRequest
- type ListResponse
- type RPCClient
- type RPCServer
- type Session
- func (*Session) Descriptor() ([]byte, []int)
- func (m *Session) GetAccessToken() *AccessToken
- func (m *Session) GetBag() map[string]string
- func (m *Session) GetExpireAt() *google_protobuf.Timestamp
- func (*Session) ProtoMessage()
- func (m *Session) Reset()
- func (m *Session) String() string
- func (s *Session) Token() (*oauth2.Token, error)
- type SetValueRequest
- type SetValueResponse
- type StartRequest
- type StartResponse
Constants ¶
const (
// AccessTokenMetadataKey is used by Mnemosyne to retrieve session token from gRPC metadata object.
AccessTokenMetadataKey = "authorization"
)
Variables ¶
This section is empty.
Functions ¶
func NewAccessTokenContext ¶
func NewAccessTokenContext(ctx context.Context, at AccessToken) context.Context
NewAccessTokenContext returns a new Context that carries Token value.
func RegisterRPCServer ¶
Types ¶
type AbandonRequest ¶
type AbandonRequest struct {
AccessToken *AccessToken `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
}
func (*AbandonRequest) Descriptor ¶
func (*AbandonRequest) Descriptor() ([]byte, []int)
func (*AbandonRequest) GetAccessToken ¶
func (m *AbandonRequest) GetAccessToken() *AccessToken
func (*AbandonRequest) ProtoMessage ¶
func (*AbandonRequest) ProtoMessage()
func (*AbandonRequest) Reset ¶
func (m *AbandonRequest) Reset()
func (*AbandonRequest) String ¶
func (m *AbandonRequest) String() string
type AbandonResponse ¶
type AbandonResponse struct {
Abandoned bool `protobuf:"varint,1,opt,name=abandoned" json:"abandoned,omitempty"`
}
func (*AbandonResponse) Descriptor ¶
func (*AbandonResponse) Descriptor() ([]byte, []int)
func (*AbandonResponse) ProtoMessage ¶
func (*AbandonResponse) ProtoMessage()
func (*AbandonResponse) Reset ¶
func (m *AbandonResponse) Reset()
func (*AbandonResponse) String ¶
func (m *AbandonResponse) String() string
type AccessToken ¶
type AccessToken struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` }
AccessToken represents identifier of single session. It consist of partition key and a hash.
func AccessTokenFromContext ¶
func AccessTokenFromContext(ctx context.Context) (AccessToken, bool)
AccessTokenFromContext returns the Token value stored in context, if any.
func DecodeAccessToken ¶
func DecodeAccessToken(s []byte) (at AccessToken)
DecodeAccessToken parse byte slice and allocates new token instance if ok. Expected token has format <key(10)><hash(n)>.
func DecodeAccessTokenString ¶
func DecodeAccessTokenString(s string) AccessToken
DecodeAccessTokenString works like DecodeToken but accepts string.
func NewAccessToken ¶
func NewAccessToken(key, hash []byte) AccessToken
NewAccessToken allocates new access token based on given key and hash. Key should not be longer than 10 elements, otherwise will be truncated. If key is shorten then 10 elements, it will be filled with zeros at the beginning.
func ParseAccessToken ¶
func ParseAccessToken(s string) AccessToken
ParseAccessToken parse given string similar way how DecodeAccessToken does with byte slice.
func RandomAccessToken ¶
func RandomAccessToken(key []byte) (at AccessToken, err error)
RandomAccessToken generate Access Token with given key and generated hash of length 64.
func (*AccessToken) Descriptor ¶
func (*AccessToken) Descriptor() ([]byte, []int)
func (AccessToken) IsEmpty ¶
func (at AccessToken) IsEmpty() bool
IsEmpty returns true if hash is zero length.
func (*AccessToken) ProtoMessage ¶
func (*AccessToken) ProtoMessage()
func (*AccessToken) Reset ¶
func (m *AccessToken) Reset()
func (*AccessToken) Scan ¶
func (at *AccessToken) Scan(src interface{}) error
Scan implements sql.Scanner interface.
func (*AccessToken) String ¶
func (m *AccessToken) String() string
type ContextResponse ¶
type ContextResponse struct {
Session *Session `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"`
}
func (*ContextResponse) Descriptor ¶
func (*ContextResponse) Descriptor() ([]byte, []int)
func (*ContextResponse) GetSession ¶
func (m *ContextResponse) GetSession() *Session
func (*ContextResponse) ProtoMessage ¶
func (*ContextResponse) ProtoMessage()
func (*ContextResponse) Reset ¶
func (m *ContextResponse) Reset()
func (*ContextResponse) String ¶
func (m *ContextResponse) String() string
type DeleteRequest ¶
type DeleteRequest struct { AccessToken *AccessToken `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` ExpireAtFrom *google_protobuf.Timestamp `protobuf:"bytes,2,opt,name=expire_at_from,json=expireAtFrom" json:"expire_at_from,omitempty"` ExpireAtTo *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=expire_at_to,json=expireAtTo" json:"expire_at_to,omitempty"` }
func (*DeleteRequest) Descriptor ¶
func (*DeleteRequest) Descriptor() ([]byte, []int)
func (*DeleteRequest) GetAccessToken ¶
func (m *DeleteRequest) GetAccessToken() *AccessToken
func (*DeleteRequest) GetExpireAtFrom ¶
func (m *DeleteRequest) GetExpireAtFrom() *google_protobuf.Timestamp
func (*DeleteRequest) GetExpireAtTo ¶
func (m *DeleteRequest) GetExpireAtTo() *google_protobuf.Timestamp
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) Reset ¶
func (m *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (m *DeleteRequest) String() string
type DeleteResponse ¶
type DeleteResponse struct {
Count int64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}
func (*DeleteResponse) Descriptor ¶
func (*DeleteResponse) Descriptor() ([]byte, []int)
func (*DeleteResponse) ProtoMessage ¶
func (*DeleteResponse) ProtoMessage()
func (*DeleteResponse) Reset ¶
func (m *DeleteResponse) Reset()
func (*DeleteResponse) String ¶
func (m *DeleteResponse) String() string
type ExistsRequest ¶
type ExistsRequest struct {
AccessToken *AccessToken `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
}
func (*ExistsRequest) Descriptor ¶
func (*ExistsRequest) Descriptor() ([]byte, []int)
func (*ExistsRequest) GetAccessToken ¶
func (m *ExistsRequest) GetAccessToken() *AccessToken
func (*ExistsRequest) ProtoMessage ¶
func (*ExistsRequest) ProtoMessage()
func (*ExistsRequest) Reset ¶
func (m *ExistsRequest) Reset()
func (*ExistsRequest) String ¶
func (m *ExistsRequest) String() string
type ExistsResponse ¶
type ExistsResponse struct {
Exists bool `protobuf:"varint,1,opt,name=exists" json:"exists,omitempty"`
}
func (*ExistsResponse) Descriptor ¶
func (*ExistsResponse) Descriptor() ([]byte, []int)
func (*ExistsResponse) ProtoMessage ¶
func (*ExistsResponse) ProtoMessage()
func (*ExistsResponse) Reset ¶
func (m *ExistsResponse) Reset()
func (*ExistsResponse) String ¶
func (m *ExistsResponse) String() string
type GetRequest ¶
type GetRequest struct {
AccessToken *AccessToken `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
}
func (*GetRequest) Descriptor ¶
func (*GetRequest) Descriptor() ([]byte, []int)
func (*GetRequest) GetAccessToken ¶
func (m *GetRequest) GetAccessToken() *AccessToken
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) Reset ¶
func (m *GetRequest) Reset()
func (*GetRequest) String ¶
func (m *GetRequest) String() string
type GetResponse ¶
type GetResponse struct {
Session *Session `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"`
}
func (*GetResponse) Descriptor ¶
func (*GetResponse) Descriptor() ([]byte, []int)
func (*GetResponse) GetSession ¶
func (m *GetResponse) GetSession() *Session
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) Reset ¶
func (m *GetResponse) Reset()
func (*GetResponse) String ¶
func (m *GetResponse) String() string
type ListRequest ¶
type ListRequest struct { Offset int64 `protobuf:"varint,1,opt,name=offset" json:"offset,omitempty"` Limit int64 `protobuf:"varint,2,opt,name=limit" json:"limit,omitempty"` ExpireAtFrom *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=expire_at_from,json=expireAtFrom" json:"expire_at_from,omitempty"` ExpireAtTo *google_protobuf.Timestamp `protobuf:"bytes,4,opt,name=expire_at_to,json=expireAtTo" json:"expire_at_to,omitempty"` }
func (*ListRequest) Descriptor ¶
func (*ListRequest) Descriptor() ([]byte, []int)
func (*ListRequest) GetExpireAtFrom ¶
func (m *ListRequest) GetExpireAtFrom() *google_protobuf.Timestamp
func (*ListRequest) GetExpireAtTo ¶
func (m *ListRequest) GetExpireAtTo() *google_protobuf.Timestamp
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) Reset ¶
func (m *ListRequest) Reset()
func (*ListRequest) String ¶
func (m *ListRequest) String() string
type ListResponse ¶
type ListResponse struct {
Sessions []*Session `protobuf:"bytes,1,rep,name=sessions" json:"sessions,omitempty"`
}
func (*ListResponse) Descriptor ¶
func (*ListResponse) Descriptor() ([]byte, []int)
func (*ListResponse) GetSessions ¶
func (m *ListResponse) GetSessions() []*Session
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) Reset ¶
func (m *ListResponse) Reset()
func (*ListResponse) String ¶
func (m *ListResponse) String() string
type RPCClient ¶
type RPCClient interface { Context(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*ContextResponse, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) Exists(ctx context.Context, in *ExistsRequest, opts ...grpc.CallOption) (*ExistsResponse, error) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) Abandon(ctx context.Context, in *AbandonRequest, opts ...grpc.CallOption) (*AbandonResponse, error) SetValue(ctx context.Context, in *SetValueRequest, opts ...grpc.CallOption) (*SetValueResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) }
func NewRPCClient ¶
func NewRPCClient(cc *grpc.ClientConn) RPCClient
type RPCServer ¶
type RPCServer interface { Context(context.Context, *google_protobuf1.Empty) (*ContextResponse, error) Get(context.Context, *GetRequest) (*GetResponse, error) List(context.Context, *ListRequest) (*ListResponse, error) Exists(context.Context, *ExistsRequest) (*ExistsResponse, error) Start(context.Context, *StartRequest) (*StartResponse, error) Abandon(context.Context, *AbandonRequest) (*AbandonResponse, error) SetValue(context.Context, *SetValueRequest) (*SetValueResponse, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) }
type Session ¶
type Session struct { AccessToken *AccessToken `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` SubjectId string `protobuf:"bytes,2,opt,name=subject_id,json=subjectId" json:"subject_id,omitempty"` SubjectClient string `protobuf:"bytes,3,opt,name=subject_client,json=subjectClient" json:"subject_client,omitempty"` Bag map[string]string `` /* 126-byte string literal not displayed */ ExpireAt *google_protobuf.Timestamp `protobuf:"bytes,5,opt,name=expire_at,json=expireAt" json:"expire_at,omitempty"` }
func (*Session) Descriptor ¶
func (*Session) GetAccessToken ¶
func (m *Session) GetAccessToken() *AccessToken
func (*Session) GetExpireAt ¶
func (m *Session) GetExpireAt() *google_protobuf.Timestamp
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
type SetValueRequest ¶
type SetValueRequest struct { AccessToken *AccessToken `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` Key string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` Value string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` }
func (*SetValueRequest) Descriptor ¶
func (*SetValueRequest) Descriptor() ([]byte, []int)
func (*SetValueRequest) GetAccessToken ¶
func (m *SetValueRequest) GetAccessToken() *AccessToken
func (*SetValueRequest) ProtoMessage ¶
func (*SetValueRequest) ProtoMessage()
func (*SetValueRequest) Reset ¶
func (m *SetValueRequest) Reset()
func (*SetValueRequest) String ¶
func (m *SetValueRequest) String() string
type SetValueResponse ¶
type SetValueResponse struct {
Bag map[string]string `` /* 126-byte string literal not displayed */
}
func (*SetValueResponse) Descriptor ¶
func (*SetValueResponse) Descriptor() ([]byte, []int)
func (*SetValueResponse) GetBag ¶
func (m *SetValueResponse) GetBag() map[string]string
func (*SetValueResponse) ProtoMessage ¶
func (*SetValueResponse) ProtoMessage()
func (*SetValueResponse) Reset ¶
func (m *SetValueResponse) Reset()
func (*SetValueResponse) String ¶
func (m *SetValueResponse) String() string
type StartRequest ¶
type StartRequest struct { SubjectId string `protobuf:"bytes,1,opt,name=subject_id,json=subjectId" json:"subject_id,omitempty"` SubjectClient string `protobuf:"bytes,2,opt,name=subject_client,json=subjectClient" json:"subject_client,omitempty"` Bag map[string]string `` /* 126-byte string literal not displayed */ }
func (*StartRequest) Descriptor ¶
func (*StartRequest) Descriptor() ([]byte, []int)
func (*StartRequest) GetBag ¶
func (m *StartRequest) GetBag() map[string]string
func (*StartRequest) ProtoMessage ¶
func (*StartRequest) ProtoMessage()
func (*StartRequest) Reset ¶
func (m *StartRequest) Reset()
func (*StartRequest) String ¶
func (m *StartRequest) String() string
type StartResponse ¶
type StartResponse struct {
Session *Session `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"`
}
func (*StartResponse) Descriptor ¶
func (*StartResponse) Descriptor() ([]byte, []int)
func (*StartResponse) GetSession ¶
func (m *StartResponse) GetSession() *Session
func (*StartResponse) ProtoMessage ¶
func (*StartResponse) ProtoMessage()
func (*StartResponse) Reset ¶
func (m *StartResponse) Reset()
func (*StartResponse) String ¶
func (m *StartResponse) String() string