Documentation ¶
Index ¶
- func BoltFile(location string) (*bolt.DB, error)
- func RedisConn(addr string) (*redis.Client, error)
- type BoltStore
- func (bs BoltStore) AddConsumerContract(buildID, pid, cid, format string, contract []byte) error
- func (bs BoltStore) AddProducerData(buildID, pid, format string, data []byte) error
- func (bs BoltStore) Commit(buildID string) error
- func (bs BoltStore) GetConsumerContract(pid, cid, format string) (string, error)
- func (bs BoltStore) GetProducerData(pid, format string) (string, error)
- func (bs BoltStore) ListProducerContracts(pid, format string) ([]string, error)
- func (bs BoltStore) Rollback(buildID string) error
- type RedisStore
- func (rs RedisStore) AddConsumerContract(buildID, pid, cid, format string, contract []byte) error
- func (rs RedisStore) AddProducerData(buildID, pid, format string, data []byte) error
- func (rs RedisStore) Commit(buildID string) error
- func (rs RedisStore) GetConsumerContract(pid, cid, format string) (string, error)
- func (rs RedisStore) GetProducerData(pid, format string) (string, error)
- func (rs RedisStore) ListProducerContracts(pid, format string) ([]string, error)
- func (rs RedisStore) Rollback(buildID string) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
func NewBoltStore ¶
func (BoltStore) AddConsumerContract ¶
func (BoltStore) AddProducerData ¶
func (BoltStore) GetConsumerContract ¶
func (BoltStore) GetProducerData ¶
func (BoltStore) ListProducerContracts ¶
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
Click to show internal directories.
Click to hide internal directories.