consent

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consent map[string]bool

func NewConsent

func NewConsent(names ...string) Consent

func (Consent) Allow

func (this Consent) Allow(name string) bool

func (Consent) GetBSON

func (this Consent) GetBSON() (interface{}, error)

[

<許可項目>,
...

]

func (Consent) SetAllow

func (this Consent) SetAllow(name string)

func (*Consent) SetBSON

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

func (Consent) SetDeny

func (this Consent) SetDeny(name string)

type Db

type Db interface {
	// 取得。
	Get(acnt, ta string) (*Element, error)

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

アカウントがどの TA にどの属性の提供を許可しているかという情報の格納庫。

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
}

アカウントがどの TA にどの情報の提供を許可しているかという情報。

func New

func New(acnt, ta string) *Element

func (*Element) Account

func (this *Element) Account() string

アカウント ID を返す。

func (*Element) Attribute

func (this *Element) Attribute() Consent

属性の許可情報を返す。

func (*Element) GetBSON

func (this *Element) GetBSON() (interface{}, error)
{
    "account": <アカウント ID>,
    "ta": <TA の ID>,
    "scopes": <許可スコープ>,
    "attributes": <許可属性>
}

func (*Element) Scope

func (this *Element) Scope() Consent

スコープの許可情報を返す。

func (*Element) SetBSON

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

func (*Element) Ta

func (this *Element) Ta() string

許可される TA の ID を返す。

Jump to

Keyboard shortcuts

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