You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to generalize an interface for an apiban store so as to facilitate more clients and intermediate caching and storage.
Proposing the following definitions:
// Store defines and interface for storing and retrieving entries in the APIBan database, local or remotetypeStoreinterface {
// Add inserts the given Listing into the store. Listing may be sparse, requiring only the IP. Returned value will be fully populated.Add(ip*Listing) (*Listing, error)
// Exists checks to see whether the given IP matches a Listing in the store, returning the first matching Listing, if one exists.Exists(ip net.IP) (*Listing, error)
// List retrieves the contents of the storeList() ([]*Listing, error)
// ListFromTime retrieves the contents of the store from the given timestampListFromTime(t time.Time) ([]*Listing, error)
// Remove deletes the given Listing from the storeRemove(ip*Listing) error// Reset empties the storeReset() error
}
// Listing is an individually-listed IP address or subnettypeListingstruct {
// ID is the unique identifier for this ListingIDstring// Timestamp is the time at which this Listing was added to the apiban.org databaseTimestamp time.Time// IP is the IP address or IP network which is in the apiban.org databaseIP net.IPNet
}
This will set us up to have a pluggable system of stores by which we can make an extensible, pluggable set of client functions.
The text was updated successfully, but these errors were encountered:
Ulexus
added a commit
to CyCoreSystems/apiban
that referenced
this issue
Mar 28, 2020
Define and use a standard Store interface for the client library. This
will allow us to extend the client to greater uses later.
Fixespalner#11
Signed-off-by: Seán C McCord <[email protected]>
Define and use a standard Store interface for the client library. This
will allow us to extend the client to greater uses later.
As an example, a RAM-based caching store has been implemented.
Fixespalner#11
Signed-off-by: Seán C McCord <[email protected]>
Ulexus
added a commit
to CyCoreSystems/apiban
that referenced
this issue
Mar 30, 2020
Define and use a standard Store interface for the client library. This
will allow us to extend the client to greater uses later.
As an example, a RAM-based caching store has been implemented.
Fixespalner#11
Signed-off-by: Seán C McCord <[email protected]>
Ulexus
added a commit
to CyCoreSystems/apiban
that referenced
this issue
Mar 30, 2020
Define and use a standard Store interface for the client library. This
will allow us to extend the client to greater uses later.
As an example, a RAM-based caching store has been implemented.
Fixespalner#11
Signed-off-by: Seán C McCord <[email protected]>
It would be useful to generalize an interface for an apiban store so as to facilitate more clients and intermediate caching and storage.
Proposing the following definitions:
This will set us up to have a pluggable system of stores by which we can make an extensible, pluggable set of client functions.
The text was updated successfully, but these errors were encountered: