Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CommandTypeKey indicates a command type ("ls-refs", "fetch", // "not-a-command"). CommandTypeKey = tag.MustNewKey("github.com/google/goblet/command-type") // CommandCacheStateKey indicates whether the command response is cached // or not ("locally-served", "queried-upstream"). CommandCacheStateKey = tag.MustNewKey("github.com/google/goblet/command-cache-state") // CommandCanonicalStatusKey indicates whether the command is succeeded // or not ("OK", "Unauthenticated"). CommandCanonicalStatusKey = tag.MustNewKey("github.com/google/goblet/command-status") // InboundCommandProcessingTime is a processing time of the inbound // commands. InboundCommandProcessingTime = stats.Int64("github.com/google/goblet/inbound-command-processing-time", "processing time of inbound commands", stats.UnitMilliseconds) // OutboundCommandProcessingTime is a processing time of the outbound // commands. OutboundCommandProcessingTime = stats.Int64("github.com/google/goblet/outbound-command-processing-time", "processing time of outbound commands", stats.UnitMilliseconds) // UpstreamFetchWaitingTime is a duration that a fetch request waited // for the upstream. UpstreamFetchWaitingTime = stats.Int64("github.com/google/goblet/upstream-fetch-waiting-time", "waiting time of upstream fetch command", stats.UnitMilliseconds) // InboundCommandCount is a count of inbound commands. InboundCommandCount = stats.Int64("github.com/google/goblet/inbound-command-count", "number of inbound commands", stats.UnitDimensionless) // OutboundCommandCount is a count of outbound commands. OutboundCommandCount = stats.Int64("github.com/google/goblet/outbound-command-count", "number of outbound commands", stats.UnitDimensionless) )
Functions ¶
func HTTPHandler ¶
func HTTPHandler(config *ServerConfig) http.Handler
func ListManagedRepositories ¶
func ListManagedRepositories(fn func(ManagedRepository))
Types ¶
type ManagedRepository ¶
type ManagedRepository interface { UpstreamURL() *url.URL LastUpdateTime() time.Time RecoverFromBundle(string) error WriteBundle(io.Writer) error }
func OpenManagedRepository ¶
func OpenManagedRepository(config *ServerConfig, u *url.URL) (ManagedRepository, error)
type RunningOperation ¶
type ServerConfig ¶
type ServerConfig struct { LocalDiskCacheRoot string URLCanonializer func(*url.URL) (*url.URL, error) RequestAuthorizer func(*http.Request) error TokenSource oauth2.TokenSource ErrorReporter func(*http.Request, error) RequestLogger func(r *http.Request, status int, requestSize, responseSize int64, latency time.Duration) LongRunningOperationLogger func(string, *url.URL) RunningOperation }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.