pairwise

package
v0.0.0-...-72324ba Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Db

type Db interface {
	// セクタ固有のアカウント ID による取得。
	GetByPairwise(sect, pw string) (*Element, error)

	// 保存。
	Save(elem *Element) error
}

セクタ固有のアカウント ID の情報の格納庫。

func NewMemoryDb

func NewMemoryDb() Db

func NewMongoDb

func NewMongoDb(pool *mgo.Session, db, coll string) Db

db: DB 名。 coll: コレクション名。

type Element

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

セクタ固有のアカウント ID の情報。

func Generate

func Generate(acnt, sect string, salt []byte) *Element

セクタ固有のアカウントを計算する。

func New

func New(acnt, sect, pw string) *Element

func (*Element) Account

func (this *Element) Account() string

真のアカウント ID を返す。

func (*Element) GetBSON

func (this *Element) GetBSON() (interface{}, error)
{
    "account": <アカウント ID>,
    "sector": <セクタ ID>,
    "pairwise": <セクタ固有のアカウント ID>
}

func (*Element) Pairwise

func (this *Element) Pairwise() string

セクタ固有のアカウント ID を返す。

func (*Element) Sector

func (this *Element) Sector() string

TA のセクタ ID を返す。

func (*Element) SetBSON

func (this *Element) SetBSON(raw bson.Raw) error

Jump to

Keyboard shortcuts

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