Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Errors ErrorReplayNotFound = errors.New("replay not found") )
View Source
var Routes = []Route{ Route{ Replay, http.MethodGet, "/replays/:id", []server.ResponseSetting{}, }, }
Routes is a list of Replayer server routes
View Source
var V1 = func() Controller { controllerOnce.Do(func() { var cfg Config if err := config.Load(&cfg); err != nil { panic(err) } ctx := context.Background() extKey := []byte{} if cfg.EncryptionKey != "" { extKey = crypto.ExtendKey( []byte(cfg.EncryptionKey), []byte(cfg.EncryptionSalt), ) } db, err := cdxjdb.New( ctx, cfg.DatabaseAddr, cfg.DropDatabaseOnStart, ) if err != nil { panic(fmt.Errorf( "Controller: failed to connect to database at "+ "address ('%s') with error: %s", cfg.DatabaseAddr, err, )) } rpl, err := replayer.New(ctx, cfg.IpfsAddress, db) if err != nil { panic(err) } control = New(ctx, extKey, rpl) }) return control }
Functions ¶
func Replay ¶
func Replay(w http.ResponseWriter, r *http.Request, p server.Parameters)
Replay handles requests to retrieve a WARC replay for the given record Id
Types ¶
type Config ¶
type Config struct { DatabaseAddr string `toml:"database_addr"` DropDatabaseOnStart bool `toml:"drop_database_on_start"` // Encyption configuraiton EncryptionKey string `toml:"encryption_key"` EncryptionSalt string `toml:"encryption_salt"` // IPFS configuration IpfsAddress string `toml:"ipfs_address"` }
Config represents the configuration of a Replayer's controller
Click to show internal directories.
Click to hide internal directories.