Documentation ¶
Index ¶
- func CopyDB(src *leveldb.DB, dst *leveldb.DB) (ncopied uint64, err error)
- type Store
- func (s *Store) Backup(path string) (err error)
- func (s *Store) Close() error
- func (s *Store) CreateCert(c *models.Certificate) (id string, err error)
- func (s *Store) CreateCertReq(r *models.CertificateRequest) (id string, err error)
- func (s *Store) CreateOrganization(o *bff.Organization) (id string, err error)
- func (s *Store) CreateVASP(v *pb.VASP) (id string, err error)
- func (s *Store) DeleteAnnouncementMonth(date string) (err error)
- func (s *Store) DeleteCert(id string) (err error)
- func (s *Store) DeleteCertReq(id string) (err error)
- func (s *Store) DeleteOrganization(id uuid.UUID) (err error)
- func (s *Store) DeleteVASP(id string) (err error)
- func (s *Store) ListCertReqs() iterator.CertificateRequestIterator
- func (s *Store) ListCerts() iterator.CertificateIterator
- func (s *Store) ListVASPs() iterator.DirectoryIterator
- func (s *Store) Reindex() (err error)
- func (s *Store) RetrieveAnnouncementMonth(date string) (m *bff.AnnouncementMonth, err error)
- func (s *Store) RetrieveCert(id string) (c *models.Certificate, err error)
- func (s *Store) RetrieveCertReq(id string) (r *models.CertificateRequest, err error)
- func (s *Store) RetrieveOrganization(id uuid.UUID) (o *bff.Organization, err error)
- func (s *Store) RetrieveVASP(id string) (v *pb.VASP, err error)
- func (s *Store) SearchVASPs(query map[string]interface{}) (vasps []*pb.VASP, err error)
- func (s *Store) UpdateAnnouncementMonth(m *bff.AnnouncementMonth) (err error)
- func (s *Store) UpdateCert(c *models.Certificate) (err error)
- func (s *Store) UpdateCertReq(r *models.CertificateRequest) (err error)
- func (s *Store) UpdateOrganization(o *bff.Organization) (err error)
- func (s *Store) UpdateVASP(v *pb.VASP) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
Store implements store.Store for some basic LevelDB operations and simple protocol buffer storage in a key/value database.
func (*Store) Backup ¶
Backup copies the leveldb database to a new directory and archives it as gzip tar. See: https://github.com/wbolster/plyvel/issues/46
func (*Store) Close ¶
Close the database, allowing no further interactions. This method also synchronizes the indices to ensure that they are saved between sessions.
func (*Store) CreateCert ¶
CreateCertReq and assign a new ID and return the version.
func (*Store) CreateCertReq ¶
CreateCertReq and assign a new ID and return the version.
func (*Store) CreateOrganization ¶ added in v1.5.2
func (s *Store) CreateOrganization(o *bff.Organization) (id string, err error)
CreateOrganization creates a new organization record in the store, assigning a unique ID if it doesn't exist and setting the created and modified timestamps.
func (*Store) CreateVASP ¶
CreateVASP into the directory. This method requires the VASP to have a unique name and ignores any ID fields that are set on the VASP, instead assigning new IDs.
func (*Store) DeleteAnnouncementMonth ¶ added in v1.5.3
DeleteAnnouncementMonth removes an announcement month "crate" from the store.
func (*Store) DeleteCert ¶
DeleteCertReq removes a certificate request from the store.
func (*Store) DeleteCertReq ¶
DeleteCertReq removes a certificate request from the store.
func (*Store) DeleteOrganization ¶ added in v1.5.2
DeleteOrganization deletes an organization record from the store by UUID.
func (*Store) DeleteVASP ¶
DeleteVASP record, removing it completely from the database and indices.
func (*Store) ListCertReqs ¶
func (s *Store) ListCertReqs() iterator.CertificateRequestIterator
ListCertReqs returns all certificate requests that are currently in the store.
func (*Store) ListCerts ¶
func (s *Store) ListCerts() iterator.CertificateIterator
ListCert returns all certificates that are currently in the store.
func (*Store) ListVASPs ¶
func (s *Store) ListVASPs() iterator.DirectoryIterator
ListVASPs returns all of the VASPs in the database
func (*Store) Reindex ¶
Reindex rebuilds the name and country indices for the server and synchronizes them back to disk to ensure they're complete and accurate.
func (*Store) RetrieveAnnouncementMonth ¶ added in v1.5.2
func (s *Store) RetrieveAnnouncementMonth(date string) (m *bff.AnnouncementMonth, err error)
RetrieveAnnouncementMonth returns the announcement month "crate" for the given month timestamp in the format YYYY-MM.
func (*Store) RetrieveCert ¶
RetrieveCert returns a certificate by certificate ID.
func (*Store) RetrieveCertReq ¶
RetrieveCertReq returns a certificate request by certificate request ID.
func (*Store) RetrieveOrganization ¶ added in v1.5.2
RetrieveOrganization retrieves an organization record from the store by UUID.
func (*Store) RetrieveVASP ¶
RetrieveVASP record by id; returns an error if the record does not exist.
func (*Store) SearchVASPs ¶
SearchVASPs uses the names and countries index to find VASPs that match the specified query. This is a very simple search and is not intended for robust usage. To find a VASP by name, a case insensitive search is performed if the query exists in any of the VASP entity names. If there is not an exact match a prefix lookup is used so long as the prefix > 3 characters. The search also looks up website matches by parsing urls to match hostnames rather than scheme or path. Finally the query is filtered by country and category.
func (*Store) UpdateAnnouncementMonth ¶ added in v1.5.2
func (s *Store) UpdateAnnouncementMonth(m *bff.AnnouncementMonth) (err error)
UpdateAnnouncementMonth creates a new announcement month "crate" if it doesn't already exist or replaces the existing record.
func (*Store) UpdateCert ¶
UpdateCert can create or update a certificate. The certificate should be as complete as possible, including an ID generated by the caller.
func (*Store) UpdateCertReq ¶
UpdateCertReq can create or update a certificate request. The request should be as complete as possible, including an ID generated by the caller.
func (*Store) UpdateOrganization ¶ added in v1.5.2
func (s *Store) UpdateOrganization(o *bff.Organization) (err error)
UpdateOrganization updates an organization record in the store by replacing the existing record.