store

package
v0.0.0-...-1142866 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoltFile

func BoltFile(location string) (*bolt.DB, error)

func RedisConn

func RedisConn(addr string) (*redis.Client, error)

RedisConn return a redis connection

Types

type BoltStore

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

func NewBoltStore

func NewBoltStore(db *bolt.DB) *BoltStore

func (BoltStore) AddConsumerContract

func (bs BoltStore) AddConsumerContract(buildID, pid, cid, format string, contract []byte) error

func (BoltStore) AddProducerData

func (bs BoltStore) AddProducerData(buildID, pid, format string, data []byte) error

func (BoltStore) Commit

func (bs BoltStore) Commit(buildID string) error

func (BoltStore) GetConsumerContract

func (bs BoltStore) GetConsumerContract(pid, cid, format string) (string, error)

func (BoltStore) GetProducerData

func (bs BoltStore) GetProducerData(pid, format string) (string, error)

func (BoltStore) ListProducerContracts

func (bs BoltStore) ListProducerContracts(pid, format string) ([]string, error)

func (BoltStore) Rollback

func (bs BoltStore) Rollback(buildID string) error

type RedisStore

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

RedisStore is the implementation of a contract store

func NewRedisStore

func NewRedisStore(rc *redis.Client) *RedisStore

NewRedisStore return a valid store.Store reference

func (RedisStore) AddConsumerContract

func (rs RedisStore) AddConsumerContract(buildID, pid, cid, format string, contract []byte) error

func (RedisStore) AddProducerData

func (rs RedisStore) AddProducerData(buildID, pid, format string, data []byte) error

func (RedisStore) Commit

func (rs RedisStore) Commit(buildID string) error

func (RedisStore) GetConsumerContract

func (rs RedisStore) GetConsumerContract(pid, cid, format string) (string, error)

GetConsumerContract fetches a consumer contract Each consumer contract have a consumer and producer id + the contract data format

func (RedisStore) GetProducerData

func (rs RedisStore) GetProducerData(pid, format string) (string, error)

GetProducerData fetches the data example of a producer

func (RedisStore) ListProducerContracts

func (rs RedisStore) ListProducerContracts(pid, format string) ([]string, error)

ListProducerContracts retrieves all contract ids of a particular producer

func (RedisStore) Rollback

func (rs RedisStore) Rollback(buildID string) error

type Store

type Store interface {
	GetConsumerContract(pid, cid, format string) (string, error)
	AddConsumerContract(buildID, pid, cid, format string, contract []byte) error
	GetProducerData(pid, format string) (string, error)
	ListProducerContracts(pid, format string) ([]string, error)
	AddProducerData(buildID, pid, format string, data []byte) error
	Commit(buildID string) error
	Rollback(buildID string) error
}

Store define persistence methods called by the API

Jump to

Keyboard shortcuts

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