store

package
v0.0.0-...-ab9d506 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const StoreDir string = "./data"

StoreDir specifies the directory to save data in

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateStores

type AggregateStores struct {
	// Jira is the store used to save Jira aggregates
	Jira *JiraAggregateStore

	// GitHub is the store used to save GitHub aggregates
	GitHub *GitHubAggregateStore

	// Links is the sotre used to save Link aggregates
	Links *LinkAggregateStore
}

AggregateStores is a collection of all the stores used to save aggregates.

func NewAggregateStores

func NewAggregateStores() (*AggregateStores, error)

NewAggregateStores creates a new AggregateStores instance. An error is returned if one occurs.

type GitHubAggregateStore

type GitHubAggregateStore struct {
	*ScribbleStore
}

GitHubAggregateStore is a store which implements an addition Get method for the GitHubAggregate.

func NewGitHubAggregateStore

func NewGitHubAggregateStore() (*GitHubAggregateStore, error)

NewGitHubAggregateStore creates a new GitHubAggregate store. An error is returned if one occurs.

func (GitHubAggregateStore) Get

Get retrieves a GitHubAggregate

type GitHubStores

type GitHubStores struct {
	// Users is the GitHub User store
	Users *GitHubUserStore
}

GitHubStores is a collection of all the stores used to save GitHub model data.

func NewGitHubStores

func NewGitHubStores() (*GitHubStores, error)

NewGitHubStores creates a new GitHubStores instance. An error is returned if one occurs.

type GitHubUserStore

type GitHubUserStore struct {
	*ScribbleStore
}

GitHubUserStore is a store which implements an addition Get method for GitHubUser models.

func NewGitHubUserStore

func NewGitHubUserStore() (*GitHubUserStore, error)

NewGitHubUserStore creates a new GitHubUser store. An error is returned if one occurs.

func (GitHubUserStore) Get

func (s GitHubUserStore) Get(id string, data *models.GitHubUser) error

Get retrieves a GitHubUser

type JiraAggregateStore

type JiraAggregateStore struct {
	*ScribbleStore
}

JiraAggregateStore is a store which implements an addition Get method for the JiraAggregate.

func NewJiraAggregateStore

func NewJiraAggregateStore() (*JiraAggregateStore, error)

NewJiraAggregateStore creates a new JiraAggregate store. An error is returned if one occurs.

func (JiraAggregateStore) Get

Get retrieves a JiraAggregate

type JiraIssueStore

type JiraIssueStore struct {
	*ScribbleStore
}

JiraIssueStore is a store which implements an addition Get method for JiraIssue models.

func NewJiraIssueStore

func NewJiraIssueStore() (*JiraIssueStore, error)

NewJiraIssueStore creates a new JiraIssue store. An error is returned if one occurs.

func (JiraIssueStore) Get

func (s JiraIssueStore) Get(id string, data *models.JiraIssue) error

Get retrieves a JiraIssue

type JiraStores

type JiraStores struct {
	// Issues is the Jira Issue store
	Issues *JiraIssueStore

	// Users is the Jira User store
	Users *JiraUserStore
}

JiraStores is a collection of all the stores used to save Jira model data.

func NewJiraStores

func NewJiraStores() (*JiraStores, error)

NewJiraStores creates a new JiraStores instance. An error is returned if one occurs.

type JiraUserStore

type JiraUserStore struct {
	*ScribbleStore
}

JiraUserStore is a store which implements an addition Get method for JiraUser models.

func NewJiraUserStore

func NewJiraUserStore() (*JiraUserStore, error)

NewJiraUserStore creates a new JiraUser store. An error is returned if one occurs.

func (JiraUserStore) Get

func (s JiraUserStore) Get(id string, data *models.JiraUser) error

Get retrieves a JiraUser

type LinkAggregateStore

type LinkAggregateStore struct {
	*ScribbleStore
}

LinkAggregateStore is a store which implements an addition Get method for LinkAggregate models.

func NewLinkAggregateStore

func NewLinkAggregateStore() (*LinkAggregateStore, error)

NewLinkAggregateStore creates a new LinkAggregate store. An error is returned if one occurs.

func (LinkAggregateStore) Get

Get retrieves a LinkAggregate

type LinkStore

type LinkStore struct {
	*ScribbleStore
}

LinkStore is a store which implements an addition Get method for Link models.

func NewLinkStore

func NewLinkStore(model string) (*LinkStore, error)

NewLinkStore creates a new Link store. The name of the model links are being stored for should be provided. An error is returned if one occurs.

func (LinkStore) Get

func (s LinkStore) Get(id string, data *models.Link) error

Get retrieves a Link

type LinkStores

type LinkStores struct {
	// Users is the store used to save User model links
	Users *LinkStore

	// Labels is the store used to save Label model links
	Labels *LinkStore

	// Issues is the store used to save Issue model links
	Issues *LinkStore
}

LinkStores is a collection of all the stores used to save Link models.

func NewLinkStores

func NewLinkStores() (*LinkStores, error)

NewLinkStores create a new LinkStores instance. An error is returned if one occurs.

type ScribbleStore

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

ScribbleStore implements the Store interface using the Scribble library

func NewScribbleStore

func NewScribbleStore(name string) (*ScribbleStore, error)

NewScribbleStore creates a new ScribbleStore for the specified store name. Returns an error if one occurs, nil on success.

func (ScribbleStore) HasKey

func (s ScribbleStore) HasKey(id string) (bool, error)

HasKey implements Store.HasKey

func (ScribbleStore) Hash

func (s ScribbleStore) Hash(id string) (string, error)

Hash implements Store.Hash

func (ScribbleStore) Keys

func (s ScribbleStore) Keys() ([]string, error)

Keys implements Store.Keys

func (ScribbleStore) Set

func (s ScribbleStore) Set(id string, data json.Marshaler) error

Set implements Store.Set

type Store

type Store interface {
	// Set saves a value in a store under a specified id. An error is
	// returned if one occurs, nil on success.
	Set(id string, data json.Marshaler) error

	// Hash retrieves the hash of the key's contents
	Hash(id string) (string, error)

	// Keys returns all the keys present in a store
	Keys() ([]string, error)

	// HasKey indicates if the store contains an entry for the provided
	// key. An error is returned if one occurs.
	HasKey(id string) (bool, error)
}

Store provides an interface for managing data store information

type Stores

type Stores struct {
	// Jira holds Jira model stores
	Jira *JiraStores

	// GitHub holds GitHub model stores
	GitHub *GitHubStores

	// Links holds Link model stores
	Links *LinkStores

	// Aggregates holds Aggregate stores
	Aggregates *AggregateStores
}

Stores is a collection of all the different stores used to save model data.

func NewStores

func NewStores() (*Stores, error)

NewStores creates a new Stores instance. An error is returned if one occurs.

Jump to

Keyboard shortcuts

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