All Projects → piotrkowalczuk → mnemosyne

piotrkowalczuk / mnemosyne

Licence: MIT License
Session management service with RPC API based on protobuf.

Programming Languages

go
31211 projects - #10 most used programming language
python
139335 projects - #7 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to mnemosyne

qtprotobuf
Protobuf generator and bindings for Qt framework
Stars: ✭ 138 (+820%)
Mutual labels:  protobuf, grpc
grphp
PHP gRPC Framework
Stars: ✭ 19 (+26.67%)
Mutual labels:  protobuf, grpc
protoc-plugin
A protoc compiler plugin for Clojure applications
Stars: ✭ 28 (+86.67%)
Mutual labels:  protobuf, grpc
Clay
Proto-first minimal server platform for gRPС+REST+Swagger APIs
Stars: ✭ 212 (+1313.33%)
Mutual labels:  protobuf, grpc
agentgo
Hi! Agentgo is a tool for making remote command executions from server to client with golang, protocol buffers (protobuf) and grpc.
Stars: ✭ 15 (+0%)
Mutual labels:  protobuf, grpc
neofs-api-go
NeoFS API Golang repository contains implementation of core NeoFS structures that can be used for integration with NeoFS.
Stars: ✭ 14 (-6.67%)
Mutual labels:  protobuf, grpc
protoactor-go
Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
Stars: ✭ 4,138 (+27486.67%)
Mutual labels:  protobuf, grpc
Buildbuddy
BuildBuddy is an open source Bazel build event viewer, result store, and remote cache.
Stars: ✭ 182 (+1113.33%)
Mutual labels:  protobuf, grpc
modern-api-management
A modern approach to manage APIs effectively using Protobuf
Stars: ✭ 36 (+140%)
Mutual labels:  protobuf, grpc
sisyphus
Sisyphus is the way how we provide backend services.
Stars: ✭ 59 (+293.33%)
Mutual labels:  protobuf, grpc
Rules protobuf
Bazel rules for building protocol buffers and gRPC services (java, c++, go, ...)
Stars: ✭ 206 (+1273.33%)
Mutual labels:  protobuf, grpc
ocaml-grpc-envoy
Using OCaml + gRPC via Envoy
Stars: ✭ 41 (+173.33%)
Mutual labels:  protobuf, grpc
Istio Micro
istio 微服务示例代码 grpc+protobuf+echo+websocket+mysql+redis+kafka+docker-compose
Stars: ✭ 194 (+1193.33%)
Mutual labels:  protobuf, grpc
compatip
A simple tool to ensure compatibility between microservices
Stars: ✭ 13 (-13.33%)
Mutual labels:  protobuf, grpc
Grpc Kotlin
gRPC with Kotlin Coroutines
Stars: ✭ 190 (+1166.67%)
Mutual labels:  protobuf, grpc
FSharp.GrpcCodeGenerator
A protoc plugin to enable generation of F# code
Stars: ✭ 61 (+306.67%)
Mutual labels:  protobuf, grpc
Rules proto
Modern bazel build rules for protobuf / gRPC
Stars: ✭ 179 (+1093.33%)
Mutual labels:  protobuf, grpc
Go Grpc Examples
This repo contains examples and implementations of different types of GRPC services and APIs using Golang.
Stars: ✭ 180 (+1100%)
Mutual labels:  protobuf, grpc
grpc-jwt-spring-boot-starter
Spring boot starter for gRPC framework with JWT authorization
Stars: ✭ 24 (+60%)
Mutual labels:  protobuf, grpc
grpc-chat
Simple Chat Server/Client implemented with gRPC
Stars: ✭ 107 (+613.33%)
Mutual labels:  protobuf, grpc

Mnemosyne CircleCI

GoDoc Test Coverage Code Climate Docker Pulls pypi

Introduction

Mnemosyne is an open-source self-hosted session management service. It's written in Go, making it easy to build and deploy as a static binary.

It provides gRPC interface. Messages are encoded using protobuf.

Quick Start

To install and run service:

$ go get -d github.com/piotrkowalczuk/mnemosyne/...
$ cd $GOPATH/src/github.com/piotrkowalczuk/mnemosyne
$ make
$ mnemosyned -log.environment=development -postgres.address='postgres://localhost/example?sslmode=disable'

Storage Engine

Goal is to support multiple storage's, like PostgreSQL, Redis or MongoDB. Nevertheless currently supported is only PostgreSQL.

Remote Procedure Call API

For communication, Mnemosyne is exposing RPC API that uses protocol buffers, Google’s mature open source mechanism for serializing structured data.

  • Create
  • Get
  • List
  • Exists
  • Abandon
  • SetData
  • Delete

Installation

Mnemosyne can be installed in one way, from source. Or can be used as a container using docker image. It is worth to mention that latest tag is released after each successful master branch build. Please use only images tagged using specific version anywhere else than a local development environment.

From source

To install from source both go tools and dep is required.

$ go get -d github.com/piotrkowalczuk/mnemosyne/...
$ cd $GOPATH/src/github.com/piotrkowalczuk/mnemosyne
$ make

Configuration

mnemosyned accepts command line arguments to control its behavior. Possible options are listed below.

Name Flag Default Type
host -host 127.0.0.1 string
port -port 8080 int
grpc debug mode -grpc.debug false boolean
cluster listen address -cluster.listen string
cluster seeds -cluster.seeds string
time to live -ttl 24m duration
time to clear -ttc 1m duration
logger environment -log.environment production enum(development, production, stackdriver)
logger level -log.level info enum(debug, info, warn, error, dpanic, panic, fatal)
storage -storage postgres enum(postgres)
postgres address -postgres.address postgres://postgres:postgres@postgres/postgres?sslmode=disable string
postgres table -postgres.table session string
postgres schema -postgres.schema mnemosyne string
tls -tls false boolean
tls certificate file -tls.crt string
tls key file -tls.key string

Running

As we know, mnemosyne can be configured in many ways. For the beginning we can start simple:

$ mnemosyned postgres.address="postgres://localhost/test?sslmode=disable"

Mnemosyne will automatically create all required tables/indexes for specified database.

Monitoring

mnemosyned works well with Prometheus. It exposes multiple metrics through /metrics endpoint, it includes:

  • mnemosyned_cache_hits_total
  • mnemosyned_cache_misses_total
  • mnemosyned_cache_refresh_total
  • mnemosyned_storage_postgres_errors_total
  • mnemosyned_storage_postgres_queries_total
  • mnemosyned_storage_postgres_query_duration_seconds
  • mnemosyned_storage_postgres_connections

Additionally to that mnemosyned is using internally promgrpc package to monitor entire incoming and outgoing RPC traffic.

Examples

Go

package main

import (
	"fmt"

	"golang.org/x/net/context"
	"github.com/piotrkowalczuk/mnemosyne"
)

func main() {
	mnemo, err := mnemosyne.New(mnemosyne.MnemosyneOpts{
		Addresses: []string{"127.0.0.1:8080"},
		Block: true,
	})
	if err != nil {
		// ...
	}
	defer mnemo.Close()

	ses, err := mnemo.Start(context.Background(), "subject-id", "subject-client", map[string]string{
		"username": "[email protected]",
		"first_name": "John",
		"last_name": "Snow",
	})
	if err != nil {
		// ...
	}

	fmt.Println(ses.AccessToken)
}

Python

Library is available through pypi and can be installed by typing pip install mnemosyne-client.

from  mnemosynerpc import session_pb2, session_pb2_grpc
import grpc


channel = grpc.insecure_channel('localhost:8080')
stub = session_pb2_grpc.SessionManagerStub(channel)

for i in range(0, 10):
	res = stub.Start(session_pb2.StartRequest(session=session_pb2.Session(subject_id=str(i))))

	res = stub.Get(session_pb2.GetRequest(access_token=res.session.access_token))
	print "%s - %s" % (res.session.access_token, res.session.expire_at.ToJsonString())

Contribution

TODO: describe

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].