rationl

package module
v0.0.0-...-3afcb65 Latest Latest
Warning

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

Go to latest
Published: May 29, 2014 License: MIT Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

rationl Project status

Online journal for tracking experiments.

Documentation

Overview

Package rationl is a generated protocol buffer package.

It is generated from these files:

rationl.proto

It has these top-level messages:

User
Investigation
Experiment

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*bolt.DB
	// contains filtered or unexported fields
}

DB represents the primary data storage.

func Open

func Open(path string, mode os.FileMode) (*DB, error)

Open opens and initializes the database.

func (*DB) Update

func (db *DB) Update(fn func(*Tx) error) error

Update executes a function in the context of a writable transaction.

func (*DB) View

func (db *DB) View(fn func(*Tx) error) error

View executes a function in the context of a read-only transaction.

type Experiment

type Experiment struct {
	ID               *string `protobuf:"bytes,1,req" json:"ID,omitempty"`
	InvestigationID  *string `protobuf:"bytes,2,req" json:"InvestigationID,omitempty"`
	Outcome          *string `protobuf:"bytes,3,req" json:"Outcome,omitempty"`
	Hypothesis       *string `protobuf:"bytes,4,req" json:"Hypothesis,omitempty"`
	Observation      *string `protobuf:"bytes,5,req" json:"Observation,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*Experiment) GetHypothesis

func (m *Experiment) GetHypothesis() string

func (*Experiment) GetID

func (m *Experiment) GetID() string

func (*Experiment) GetInvestigationID

func (m *Experiment) GetInvestigationID() string

func (*Experiment) GetObservation

func (m *Experiment) GetObservation() string

func (*Experiment) GetOutcome

func (m *Experiment) GetOutcome() string

func (*Experiment) GoString

func (this *Experiment) GoString() string

func (*Experiment) Marshal

func (m *Experiment) Marshal() (data []byte, err error)

func (*Experiment) MarshalTo

func (m *Experiment) MarshalTo(data []byte) (n int, err error)

func (*Experiment) ProtoMessage

func (*Experiment) ProtoMessage()

func (*Experiment) Reset

func (m *Experiment) Reset()

func (*Experiment) Size

func (m *Experiment) Size() (n int)

func (*Experiment) String

func (m *Experiment) String() string

func (*Experiment) Unmarshal

func (m *Experiment) Unmarshal(data []byte) error

type Investigation

type Investigation struct {
	ID               *string `protobuf:"bytes,1,req" json:"ID,omitempty"`
	UserID           *int64  `protobuf:"varint,2,req" json:"UserID,omitempty"`
	Name             *string `protobuf:"bytes,4,req" json:"Name,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*Investigation) GetID

func (m *Investigation) GetID() string

func (*Investigation) GetName

func (m *Investigation) GetName() string

func (*Investigation) GetUserID

func (m *Investigation) GetUserID() int64

func (*Investigation) GoString

func (this *Investigation) GoString() string

func (*Investigation) Marshal

func (m *Investigation) Marshal() (data []byte, err error)

func (*Investigation) MarshalTo

func (m *Investigation) MarshalTo(data []byte) (n int, err error)

func (*Investigation) ProtoMessage

func (*Investigation) ProtoMessage()

func (*Investigation) Reset

func (m *Investigation) Reset()

func (*Investigation) Size

func (m *Investigation) Size() (n int)

func (*Investigation) String

func (m *Investigation) String() string

func (*Investigation) Unmarshal

func (m *Investigation) Unmarshal(data []byte) error

type Session

type Session struct {
	*sessions.Session
	User  *User
	Error error
}

Session represents an authenticated session.

func (*Session) Authenticated

func (s *Session) Authenticated() bool

Authenticated returns true if there is a user attached to the session.

type Tx

type Tx struct {
	*bolt.Tx
	// contains filtered or unexported fields
}

Tx represents a transaction.

func (*Tx) CreateInvestigation

func (tx *Tx) CreateInvestigation(i *Investigation) error

CreateInvestigation creates a new investigation.

func (*Tx) FindOrCreateUserByAccessToken

func (tx *Tx) FindOrCreateUserByAccessToken(token string) (*User, error)

FindOrCreateUserByAccessToken retrieves or creates a new user based on an access token provided by GitHub.

func (*Tx) GitHubClient

func (tx *Tx) GitHubClient(token string) *github.Client

GitHubClient returns an instance of the GitHub client for a given access token.

func (*Tx) Investigation

func (tx *Tx) Investigation(id string) *Investigation

Investigation retrieves an investigation from the database by ID.

func (*Tx) InvestigationsByUserID

func (tx *Tx) InvestigationsByUserID(id int64) []*Investigation

InvestigationsByUserID retrieves a list of investigations by user id.

func (*Tx) SaveUser

func (tx *Tx) SaveUser(u *User) error

SaveUser stores an user in the database.

func (*Tx) Session

func (tx *Tx) Session(r *http.Request) *Session

Parses a session for a given HTTP request.

func (*Tx) User

func (tx *Tx) User(id int64) *User

User retrieves an user from the database by ID.

type User

type User struct {
	ID               *int64  `protobuf:"varint,1,req" json:"ID,omitempty"`
	Email            *string `protobuf:"bytes,3,req" json:"Email,omitempty"`
	AccessToken      *string `protobuf:"bytes,4,req" json:"AccessToken,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*User) GetAccessToken

func (m *User) GetAccessToken() string

func (*User) GetEmail

func (m *User) GetEmail() string

func (*User) GetID

func (m *User) GetID() int64

func (*User) GoString

func (this *User) GoString() string

func (*User) Marshal

func (m *User) Marshal() (data []byte, err error)

func (*User) MarshalTo

func (m *User) MarshalTo(data []byte) (n int, err error)

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) Size

func (m *User) Size() (n int)

func (*User) String

func (m *User) String() string

func (*User) Unmarshal

func (m *User) Unmarshal(data []byte) error

Directories

Path Synopsis
cmd
rationl command

Jump to

Keyboard shortcuts

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