Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UpstreamHeaderList is a list of headers to be used when fetching the
	// original content location.
	UpstreamHeaderList = "X-Lfs-Cache-Header-List"

	// OriginalHrefHeader is the href link to the original content location.
	OriginalHrefHeader = "X-Lfs-Cache-Original-Href"

	// SizeHeader is the size of the content to be downloaded.
	SizeHeader = "X-Lfs-Cache-Size"

	// SignatureHeader is a signature used to prove the server is the author of
	// additional headers.
	SignatureHeader = "X-Lfs-Signature"

	// ContentCachePathPrefix is the path prefix for cached content delivery.
	ContentCachePathPrefix = "/_lfs_cache/"
)

Variables

This section is empty.

Functions

func DefaultObjectBatchActionURLRewriter added in v0.1.2

func DefaultObjectBatchActionURLRewriter(href *url.URL) *url.URL

Types

type BatchObjectActionResponse

type BatchObjectActionResponse struct {
	Href      string            `json:"href"`
	Header    map[string]string `json:"header,omitempty"`
	ExpiresIn int               `json:"expires_in,omitempty"`
	ExpiresAt time.Time         `json:"expires_at,omitempty"`
}

BatchObjectActionResponse is the action item of a BatchObjectResponse

type BatchObjectResponse

type BatchObjectResponse struct {
	OID           string                                `json:"oid"`
	Size          int64                                 `json:"size"`
	Authenticated bool                                  `json:"authenticated,omitempty"`
	Actions       map[string]*BatchObjectActionResponse `json:"actions"`
}

BatchObjectResponse is the object item of a BatchResponse

type BatchResponse

type BatchResponse struct {
	Transfer string                 `json:"transfer,omitempty"`
	Objects  []*BatchObjectResponse `json:"objects"`
}

BatchResponse represents a batch response payload.

https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md#successful-responses

type Server

type Server struct {
	ObjectBatchActionURLRewriter func(href *url.URL) *url.URL
	// contains filtered or unexported fields
}

Server is a LFS caching server.

func New

func New(logger log.Logger, upstream, directory string) (*Server, error)

New returns a new LFS proxy caching server.

func NewNoCache added in v0.1.2

func NewNoCache(logger log.Logger, upstream string) (*Server, error)

NewNoCache returns a new LFS proxy server, with no caching.

func (*Server) Handle

func (s *Server) Handle() http.Handler

Handle returns this server's http.Handler.

func (*Server) Logger

func (s *Server) Logger() log.Logger

Logger returns the server logger.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL