Documentation ¶
Index ¶
- Constants
- Variables
- type Authenticator
- type CustomerDetails
- type HashHandler
- func (hh *HashHandler) GetShardsInTimeframe(cid uint64, guid uuid.UUID, well string, tf util.Timeframe) (shards []string, err error)
- func (hh *HashHandler) GetTags(custid uint64, indexerUUID uuid.UUID) (tgs []tags.TagPair, err error)
- func (hh *HashHandler) GetWellTimeframe(cid uint64, guid uuid.UUID, well string) (t util.Timeframe, err error)
- func (hh *HashHandler) ListIndexerWells(cid uint64, guid uuid.UUID) (r []string, err error)
- func (hh *HashHandler) ListIndexes(cid uint64) (r []string, err error)
- func (hh *HashHandler) PackShard(custid uint64, indexerUUID uuid.UUID, well string, shardID string, ...) error
- func (hh *HashHandler) SyncTags(custid uint64, indexerUUID uuid.UUID) (tgs []tags.TagPair, err error)
- func (hh *HashHandler) UnpackShard(custid uint64, indexerUUID uuid.UUID, well string, shardID string, ...) error
- type LoginResponse
- type ShardHandler
- type Webserver
- type WebserverConfig
Constants ¶
View Source
const ( LOGIN_PATH string = "/api/login" TEST_PATH string = "/api/test" AUTH_TEST_PATH string = "/api/testauth" SHARD_PATH string = "/api/shard/{custid}/{uuid}/{well}/{shardid}" CUST_PATH string = "/api/shard/{custid}" INDEXER_PATH string = "/api/shard/{custid}/{uuid}" WELL_PATH string = "/api/shard/{custid}/{uuid}/{well}" TAG_PATH string = "/api/tags/{custid}/{uuid}" )
Variables ¶
View Source
var ( ErrInvalidChainArgs = errors.New("invalid base chain arguments") ErrVariableNotFound = errors.New("Variable not found in request") )
View Source
var (
ErrMissingJWTToken = errors.New("Missing JWT token")
)
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type CustomerDetails ¶
type CustomerDetails struct {
CustomerNumber uint64
}
type HashHandler ¶
type HashHandler struct {
Hash []byte
}
mock handler for use in testing
func (*HashHandler) GetShardsInTimeframe ¶
func (*HashHandler) GetWellTimeframe ¶
func (*HashHandler) ListIndexerWells ¶
func (*HashHandler) ListIndexes ¶
func (hh *HashHandler) ListIndexes(cid uint64) (r []string, err error)
type LoginResponse ¶
type ShardHandler ¶
type ShardHandler interface { UnpackShard(cid uint64, guid uuid.UUID, well, shard string, rdr io.Reader) error PackShard(cid uint64, guid uuid.UUID, well, shard string, wtr io.Writer) error ListIndexes(cid uint64) ([]string, error) ListIndexerWells(cid uint64, guid uuid.UUID) ([]string, error) GetWellTimeframe(cid uint64, guid uuid.UUID, well string) (util.Timeframe, error) GetShardsInTimeframe(cid uint64, guid uuid.UUID, well string, tf util.Timeframe) (shards []string, err error) GetTags(cid uint64, guid uuid.UUID) ([]tags.TagPair, error) SyncTags(cid uint64, guid uuid.UUID, idxTags []tags.TagPair) (tgs []tags.TagPair, err error) }
type Webserver ¶
type Webserver struct {
// contains filtered or unexported fields
}
func NewWebserver ¶
func NewWebserver(conf WebserverConfig) (*Webserver, error)
func (*Webserver) AuthUser ¶
func (w *Webserver) AuthUser(res http.ResponseWriter, req *http.Request) (cust *CustomerDetails)
AuthUser ensures the user is authenticated and allows the mux to continue
type WebserverConfig ¶
type WebserverConfig struct { ListenString string // addr:port DisableTLS bool CertFile string KeyFile string Logger *log.Logger ShardHandler ShardHandler Auth Authenticator }
Click to show internal directories.
Click to hide internal directories.