Documentation
¶
Index ¶
- Variables
- type Config
- type HttpServerConfig
- type LabAPIServerImpl
- func (s *LabAPIServerImpl) GetRecentLocallyBuiltBlocks(ctx context.Context, ...) (*connect.Response[proto.GetRecentLocallyBuiltBlocksResponse], error)
- func (s *LabAPIServerImpl) GetSlotData(ctx context.Context, req *connect.Request[proto.GetSlotDataRequest]) (*connect.Response[proto.GetSlotDataResponse], error)
- type Service
- type SrvClientConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var StandardHTTPHeaders = map[string]string{
"Cache-Control": "max-age=30, s-maxage=30, public",
"Cache-Control-Tiny": "max-age=1, s-maxage=1, public",
"Cache-Control-Short": "max-age=10, s-maxage=10, public",
"Cache-Control-Medium": "max-age=60, s-maxage=60, public",
"Cache-Control-Long": "max-age=300, s-maxage=300, public",
"Cache-Control-VeryLong": "max-age=3600, s-maxage=3600, public",
}
StandardHTTPHeaders defines common HTTP headers that can be set on responses
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
LogLevel string `yaml:"logLevel" default:"info"`
HttpServer HttpServerConfig `yaml:"httpServer"`
Cache *cache.Config `yaml:"cache"`
Storage *storage.Config `yaml:"storage"`
SrvClient *SrvClientConfig `yaml:"srvClient"`
}
Config contains the configuration for the API service
type HttpServerConfig ¶
type HttpServerConfig struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
PathPrefix string `yaml:"pathPrefix" default:"/lab-data"`
CORSAllowAll bool `yaml:"corsAllowAll" default:"true"`
AllowedOrigins []string `yaml:"allowedOrigins"`
}
HttpServerConfig contains the configuration for the HTTP server
type LabAPIServerImpl ¶
type LabAPIServerImpl struct {
apipb.LabAPIHandler
// contains filtered or unexported fields
}
func NewLabAPIServer ¶
func NewLabAPIServer(cacheClient cache.Client, storageClient storage.Client, srvConn *grpc.ClientConn, log logrus.FieldLogger) *LabAPIServerImpl
func (*LabAPIServerImpl) GetRecentLocallyBuiltBlocks ¶
func (s *LabAPIServerImpl) GetRecentLocallyBuiltBlocks(ctx context.Context, req *connect.Request[proto.GetRecentLocallyBuiltBlocksRequest]) (*connect.Response[proto.GetRecentLocallyBuiltBlocksResponse], error)
GetRecentLocallyBuiltBlocks retrieves recent locally built blocks for a network
func (*LabAPIServerImpl) GetSlotData ¶
func (s *LabAPIServerImpl) GetSlotData(ctx context.Context, req *connect.Request[proto.GetSlotDataRequest]) (*connect.Response[proto.GetSlotDataResponse], error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents the api service
type SrvClientConfig ¶
func (*SrvClientConfig) Validate ¶
func (c *SrvClientConfig) Validate() error
Validate validates the SrvClientConfig
Click to show internal directories.
Click to hide internal directories.