server

package
v0.0.0-...-476a632 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundObject = errors.New("Not found object")
	ErrNotFoundIter   = errors.New("Not found iter")
)

Functions

This section is empty.

Types

type Door

type Door struct {
	*pb.UnimplementedDoorServer
	// contains filtered or unexported fields
}

func NewDoor

func NewDoor(root string) *Door

func (*Door) RunGit

func (d *Door) RunGit(pack pb.Door_RunGitServer) error

RunGit 执行git命令

type EncodedObject

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

func NewEncodedObject

func NewEncodedObject(ctx context.Context, uuid, repoPath string, obj plumbing.EncodedObject) *EncodedObject

func (*EncodedObject) Hash

func (o *EncodedObject) Hash() plumbing.Hash

func (*EncodedObject) PBEncodeObject

func (o *EncodedObject) PBEncodeObject() *pb.EncodedObject

func (*EncodedObject) Reader

func (o *EncodedObject) Reader() (io.ReadCloser, error)

func (*EncodedObject) SetSize

func (o *EncodedObject) SetSize(s int64)

func (*EncodedObject) SetType

func (o *EncodedObject) SetType(t plumbing.ObjectType)

func (*EncodedObject) Size

func (o *EncodedObject) Size() int64

func (*EncodedObject) Type

func (o *EncodedObject) Type() plumbing.ObjectType

func (*EncodedObject) UUID

func (o *EncodedObject) UUID() string

func (*EncodedObject) Writer

func (o *EncodedObject) Writer() (io.WriteCloser, error)

type EncodedObjectIterExt

type EncodedObjectIterExt struct {
	storer.EncodedObjectIter
	// contains filtered or unexported fields
}

func (*EncodedObjectIterExt) UUID

func (e *EncodedObjectIterExt) UUID() string

type Object

type Object interface {
	UUID() string
}

type ObjectCache

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

func NewObjectCache

func NewObjectCache(objectTimeout time.Duration) *ObjectCache

func (*ObjectCache) Get

func (c *ObjectCache) Get(uuid string) (Object, bool)

func (*ObjectCache) Set

func (c *ObjectCache) Set(obj Object)

type ServerCommand

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

ServerCommand is used for a single server command execution.

func (*ServerCommand) Close

func (s *ServerCommand) Close() error

func (*ServerCommand) Read

func (s *ServerCommand) Read(p []byte) (n int, err error)

func (*ServerCommand) Start

func (s *ServerCommand) Start() error

Start 协议:第一个请求仅传git相关的参数,不传数据

func (*ServerCommand) Write

func (s *ServerCommand) Write(p []byte) (n int, err error)

type Store

type Store struct {
	*pb.UnimplementedStorerServer
	// contains filtered or unexported fields
}

func NewStore

func NewStore(root string) *Store

func (*Store) CheckAndSetReference

func (s *Store) CheckAndSetReference(ctx context.Context, params *pb.SetReferenceParams) (*pb.None, error)

func (*Store) CountLooseRefs

func (s *Store) CountLooseRefs(ctx context.Context, none *pb.None) (*pb.Int64, error)

func (*Store) EncodedObjectClose

func (s *Store) EncodedObjectClose(ctx context.Context, none *pb.None) (*pb.None, error)

func (*Store) EncodedObjectEntity

func (s *Store) EncodedObjectEntity(ctx context.Context, objEntity *pb.GetEncodeObject) (*pb.EncodedObject, error)

func (*Store) EncodedObjectForEach

func (s *Store) EncodedObjectForEach(none *pb.None, stream pb.Storer_EncodedObjectForEachServer) error

func (*Store) EncodedObjectHash

func (s *Store) EncodedObjectHash(ctx context.Context, none *pb.None) (*pb.Hash, error)

func (*Store) EncodedObjectNext

func (s *Store) EncodedObjectNext(ctx context.Context, none *pb.None) (*pb.EncodedObject, error)

EncodedObjectNext(context.Context, *None) (*EncodedObject, error)

func (*Store) EncodedObjectRWStream

func (s *Store) EncodedObjectRWStream(stream pb.Storer_EncodedObjectRWStreamServer) error

func (*Store) EncodedObjectSize

func (s *Store) EncodedObjectSize(ctx context.Context, none *pb.None) (*pb.Int64, error)

func (*Store) EncodedObjectType

func (s *Store) EncodedObjectType(ctx context.Context, none *pb.None) (*pb.Int, error)

func (*Store) GetConfig

func (s *Store) GetConfig(ctx context.Context, none *pb.None) (*pb.Config, error)

func (*Store) GetIndex

func (s *Store) GetIndex(ctx context.Context, none *pb.None) (*pb.Index, error)

func (*Store) GetReference

func (s *Store) GetReference(ctx context.Context, name *pb.ReferenceName) (*pb.Reference, error)

func (*Store) GetReferences

func (s *Store) GetReferences(ctx context.Context, none *pb.None) (*pb.References, error)

func (*Store) Modules

func (s *Store) Modules(ctx context.Context, none *pb.None) (*pb.ModuleNames, error)

func (*Store) NewEncodedObject

func (s *Store) NewEncodedObject(ctx context.Context, none *pb.None) (*pb.UUID, error)

func (*Store) NewEncodedObjectIter

func (s *Store) NewEncodedObjectIter(ctx context.Context, tp *pb.ObjectType) (*pb.None, error)

func (*Store) PackRefs

func (s *Store) PackRefs(ctx context.Context, none *pb.None) (*pb.None, error)

func (*Store) RemoveReference

func (s *Store) RemoveReference(ctx context.Context, name *pb.ReferenceName) (*pb.None, error)

func (*Store) SetConfig

func (s *Store) SetConfig(ctx context.Context, c *pb.Config) (*pb.None, error)

func (*Store) SetEncodedObject

func (s *Store) SetEncodedObject(ctx context.Context, uuid *pb.UUID) (*pb.Hash, error)

func (*Store) SetEncodedObjectSetSize

func (s *Store) SetEncodedObjectSetSize(ctx context.Context, i *pb.Int64) (*pb.None, error)

func (*Store) SetEncodedObjectType

func (s *Store) SetEncodedObjectType(ctx context.Context, i *pb.Int) (*pb.None, error)

func (*Store) SetIndex

func (s *Store) SetIndex(ctx context.Context, idx *pb.Index) (*pb.None, error)

func (*Store) SetReference

func (s *Store) SetReference(ctx context.Context, reference *pb.Reference) (*pb.None, error)

func (*Store) SetShallow

func (s *Store) SetShallow(ctx context.Context, hashs *pb.Hashs) (*pb.None, error)

func (*Store) Shallow

func (s *Store) Shallow(ctx context.Context, none *pb.None) (*pb.Hashs, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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