Skip to content

Commit

Permalink
rhp4: combine client and server packages
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Sep 13, 2024
1 parent 2ea0695 commit 570b9fb
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 311 deletions.
262 changes: 0 additions & 262 deletions rhp/v4/host/host.go

This file was deleted.

12 changes: 6 additions & 6 deletions rhp/v4/host/options.go → rhp/v4/options.go
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
package host
package rhp

import (
"time"

"go.uber.org/zap"
)

// A ServerOption sets an option on a Server.
type ServerOption func(*Server)
// An Option sets an option on a Server.
type Option func(*Server)

// WithLog sets the logger for the server.
func WithLog(log *zap.Logger) ServerOption {
func WithLog(log *zap.Logger) Option {
return func(s *Server) {
s.log = log
}
}

// WithPriceTableValidity sets the duration for which a price table is valid.
func WithPriceTableValidity(validity time.Duration) ServerOption {
func WithPriceTableValidity(validity time.Duration) Option {
return func(s *Server) {
s.priceTableValidity = validity
}
}

// WithContractProofWindowBuffer sets the buffer for revising a contract before
// its proof window starts.
func WithContractProofWindowBuffer(buffer uint64) ServerOption {
func WithContractProofWindowBuffer(buffer uint64) Option {
return func(s *Server) {
s.contractProofWindowBuffer = buffer
}
Expand Down
Loading

0 comments on commit 570b9fb

Please sign in to comment.