Documentation ¶
Index ¶
- Constants
- Variables
- func ZetaEncodeVND(w io.Writer, a any)
- type Addr
- type Command
- type LsRemote
- type Metadata
- type Objects
- type ParseArgs
- type ParseOptionHandler
- type Push
- type RunCtx
- type Server
- func (s *Server) BatchCheck(e *Session, refname string) int
- func (s *Server) BatchMetadata(e *Session, depth int) int
- func (s *Server) BatchObjects(e *Session) int
- func (s *Server) BranchPush(e *Session, branchName string, oldRev, newRev plumbing.Hash) int
- func (s *Server) FetchMetadata(e *Session, c *Metadata) int
- func (s *Server) GetObject(e *Session, oid plumbing.Hash, offset int64) int
- func (s *Server) GetSparseMetadata(e *Session, c *Metadata) int
- func (s *Server) ListenAndServe() error
- func (s *Server) LsBranchReference(e *Session, branchName string) int
- func (s *Server) LsRemote(e *Session, repoPath, refname string) int
- func (s *Server) LsTagReference(e *Session, tagName string) int
- func (s *Server) NewSession(se ssh.Session) (*Session, error)
- func (s *Server) OnKey(ctx ssh.Context, key ssh.PublicKey) bool
- func (s *Server) OnSession(sess ssh.Session)
- func (s *Server) Push(e *Session, referenceName string, oldRev, newRev plumbing.Hash) int
- func (s *Server) PutObject(e *Session, refname string, oid plumbing.Hash, compressedSize int64) int
- func (s *Server) ShareObjects(e *Session) int
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) TagPush(e *Session, tagName string, oldRev, newRev plumbing.Hash) int
- type ServerConfig
- type Session
- func (e *Session) ExitError(err error) int
- func (e *Session) ExitFormat(code int, format string, a ...any) int
- func (e *Session) Getenv(k string) string
- func (e *Session) HasEnv(k string) bool
- func (e *Session) LookupEnv(k string) (string, bool)
- func (e *Session) Read(data []byte) (int, error)
- func (e *Session) W(message string) string
- func (e *Session) Write(data []byte) (int, error)
- func (e *Session) WriteError(format string, args ...any)
- type SessionCtx
Constants ¶
View Source
const ( GeneralBranch = 0 ProtectedBranch = 10 ArchivedBranch = 20 ConfidentialBranch = 30 )
View Source
const ( DefaultMaxTimeout = 2 * time.Hour DefaultIdleTimeout = 5 * time.Minute )
View Source
const ( REQUIRED int = iota NOARG OPTIONAL )
option argument type
View Source
const ( DefaultUser = "zeta" ServeCommand = "zeta-serve" AnonymousUserName = "Anonymous" )
Variables ¶
View Source
var ( ErrNilArgs = errors.New("argv is nil") ErrUnExpectedArg = errors.New("unexpected argument '-'") )
error
View Source
var (
ErrPathNecessary = errors.New("path is necessary")
)
View Source
var (
ErrRequiredContext = errors.New("required context")
)
Functions ¶
func ZetaEncodeVND ¶
Types ¶
type Command ¶
func NewCommand ¶
type Metadata ¶
type ParseArgs ¶
type ParseArgs struct {
// contains filtered or unexported fields
}
ParseArgs todo
type ParseOptionHandler ¶
type Push ¶
type Server ¶
type Server struct { *ServerConfig // contains filtered or unexported fields }
zeta co zeta@zeta.io:zeta-dev/zeta
func NewServer ¶
func NewServer(sc *ServerConfig) (*Server, error)
func (*Server) BatchObjects ¶
func (*Server) BranchPush ¶
func (*Server) ListenAndServe ¶
func (*Server) LsBranchReference ¶
func (*Server) ShareObjects ¶
type ServerConfig ¶
type ServerConfig struct { Listen string `toml:"listen"` Repositories string `toml:"repositories"` Endpoint string `toml:"endpoint"` MaxTimeout serve.Duration `toml:"max_timeout,omitempty"` IdleTimeout serve.Duration `toml:"idle_timeout,omitempty"` BannerVersion string `toml:"banner_version,omitempty"` HostPrivateKeys []string `toml:"host_private_keys"` // private keys DecryptedKey string `toml:"decrypted_key,omitempty"` Cache *serve.Cache `toml:"cache,omitempty"` DB *serve.Database `toml:"database,omitempty"` ZetaOSS *serve.OSS `toml:"oss,omitempty"` }
func NewServerConfig ¶
func NewServerConfig(file string, expandEnv bool) (*ServerConfig, error)
type Session ¶
type Session struct { ssh.Session *SessionCtx // contains filtered or unexported fields }
func (*Session) WriteError ¶
WriteError: format error after write to session.Stderr
Source Files ¶
Click to show internal directories.
Click to hide internal directories.