apiserver

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateMiddleware added in v0.4.2

func AuthenticateMiddleware(getAuthnS func(r *http.Request) auth.AuthnStore) func(handler http.Handler) http.Handler

func AuthorizeMiddleware added in v0.4.2

func AuthorizeMiddleware(getAuthzS func(r *http.Request) auth.AuthzStore, pathPrefix *regexp.Regexp, maskUnauthorizedPath bool) func(handler http.Handler) http.Handler

func CommitPayload added in v0.4.0

func CommitPayload(com *objects.Commit) *payload.Commit

func SetClaims added in v0.5.0

func SetClaims(r *http.Request, claims *auth.Claims) *http.Request

Types

type ReceivePackSession

type ReceivePackSession struct {
	// contains filtered or unexported fields
}

func NewReceivePackSession

func NewReceivePackSession(db objects.Store, rs ref.Store, c *conf.Config, id uuid.UUID, debugOut io.Writer) *ReceivePackSession

func (*ReceivePackSession) ServeHTTP

func (s *ReceivePackSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) bool

ServeHTTP receives, saves objects and update refs, returns true when session is finished and can be removed.

type ReceivePackSessionMap

type ReceivePackSessionMap struct {
	// contains filtered or unexported fields
}

func NewReceivePackSessionMap

func NewReceivePackSessionMap() *ReceivePackSessionMap

func (*ReceivePackSessionMap) Delete

func (m *ReceivePackSessionMap) Delete(sid uuid.UUID)

func (*ReceivePackSessionMap) Get

func (m *ReceivePackSessionMap) Get(sid uuid.UUID) (ses *ReceivePackSession, ok bool)

func (*ReceivePackSessionMap) Set

type ReceivePackSessionStore

type ReceivePackSessionStore interface {
	Set(sid uuid.UUID, ses *ReceivePackSession)
	Get(sid uuid.UUID) (ses *ReceivePackSession, ok bool)
	Delete(sid uuid.UUID)
}

type Server added in v0.4.0

type Server struct {
	// contains filtered or unexported fields
}

func NewServer added in v0.4.0

func NewServer(
	rootPath *regexp.Regexp, getAuthnS func(r *http.Request) auth.AuthnStore, getDB func(r *http.Request) objects.Store, getRS func(r *http.Request) ref.Store,
	getConfS func(r *http.Request) conf.Store, getUpSession func(r *http.Request) UploadPackSessionStore, getRPSession func(r *http.Request) ReceivePackSessionStore,
	opts ...ServerOption,
) *Server

func (*Server) ServeHTTP added in v0.4.0

func (s *Server) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type ServerOption added in v0.4.0

type ServerOption func(s *Server)

func WithDebug added in v0.5.0

func WithDebug(w io.Writer) ServerOption

func WithPostCommitCallback added in v0.3.16

func WithPostCommitCallback(postCommit func(r *http.Request, commit *objects.Commit, sum []byte, branch string)) ServerOption

type UploadPackSession

type UploadPackSession struct {
	// contains filtered or unexported fields
}

func NewUploadPackSession

func NewUploadPackSession(db objects.Store, rs ref.Store, id uuid.UUID, maxPackfileSize uint64) *UploadPackSession

func (*UploadPackSession) ServeHTTP

func (s *UploadPackSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) bool

ServeHTTP negotiates which commits to be sent and send them in one or more packfiles, returns true when this session is completed and should be removed.

type UploadPackSessionMap

type UploadPackSessionMap struct {
	// contains filtered or unexported fields
}

func NewUploadPackSessionMap

func NewUploadPackSessionMap() *UploadPackSessionMap

func (*UploadPackSessionMap) Delete

func (m *UploadPackSessionMap) Delete(sid uuid.UUID)

func (*UploadPackSessionMap) Get

func (m *UploadPackSessionMap) Get(sid uuid.UUID) (ses *UploadPackSession, ok bool)

func (*UploadPackSessionMap) Set

func (m *UploadPackSessionMap) Set(sid uuid.UUID, ses *UploadPackSession)

type UploadPackSessionStore

type UploadPackSessionStore interface {
	Set(sid uuid.UUID, ses *UploadPackSession)
	Get(sid uuid.UUID) (ses *UploadPackSession, ok bool)
	Delete(sid uuid.UUID)
}

Jump to

Keyboard shortcuts

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