mnemosynerpc

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

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:

Session
GetRequest
GetResponse
ContextResponse
ListRequest
ListResponse
ExistsRequest
ExistsResponse
StartRequest
StartResponse
AbandonRequest
AbandonResponse
SetValueRequest
SetValueResponse
DeleteRequest
DeleteResponse

Index

Constants

View Source
const (

	// AccessTokenMetadataKey is used by Mnemosyne to retrieve session token from gRPC metadata object.
	AccessTokenMetadataKey = "authorization"
)

Variables

This section is empty.

Functions

func AccessTokenFromContext

func AccessTokenFromContext(ctx context.Context) (string, bool)

AccessTokenFromContext returns the token value stored in context, if any.

func NewAccessToken

func NewAccessToken(key, hash string) string

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 NewAccessTokenContext

func NewAccessTokenContext(ctx context.Context, at string) context.Context

NewAccessTokenContext returns a new Context that carries token value.

func RandomAccessToken

func RandomAccessToken(key string) (at string, err error)

RandomAccessToken generate Access Token with given key and generated hash of length 64.

func RegisterSessionManagerServer added in v0.2.0

func RegisterSessionManagerServer(s *grpc.Server, srv SessionManagerServer)

Types

type AbandonRequest

type AbandonRequest struct {
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
}

func (*AbandonRequest) Descriptor

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

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 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  string                     `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) 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 string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
}

func (*ExistsRequest) Descriptor

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

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 string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
}

func (*GetRequest) Descriptor

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

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 Session

type Session struct {
	AccessToken   string                     `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) Descriptor() ([]byte, []int)

func (*Session) GetBag

func (m *Session) GetBag() map[string]string

func (*Session) GetExpireAt

func (m *Session) GetExpireAt() *google_protobuf.Timestamp

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) Reset

func (m *Session) Reset()

func (*Session) String

func (m *Session) String() string

func (*Session) Token

func (s *Session) Token() (*oauth2.Token, error)

Token implements oauth2.TokenSource interface.

type SessionManagerClient added in v0.2.0

type SessionManagerClient 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 NewSessionManagerClient added in v0.2.0

func NewSessionManagerClient(cc *grpc.ClientConn) SessionManagerClient

type SetValueRequest

type SetValueRequest struct {
	AccessToken string `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) 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

Jump to

Keyboard shortcuts

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