pkgs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0, Apache-2.0 Imports: 31 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Executable, _ = os.Executable()
	Pid           = fmt.Sprintf("%v", os.Getpid())
)

Functions

func AddNetrc

func AddNetrc(token string) (err error)

AddNetrc item in format github.com=login:pass

func Cname

func Cname() string

func Commands

func Commands(getContext func() context.Context,
	getClientConn func() *grpc.ClientConn) (commands []*cobra.Command)

func DisplayPkg

func DisplayPkg(pkg *Pkg)

func EnvReserved

func EnvReserved(name string) bool

func Extract

func Extract() (filenames []string, err error)

func GetLocalIp

func GetLocalIp() (localIp string)

func LatestVersion

func LatestVersion(name string) (latest string)

func LoadEnvirons

func LoadEnvirons(target string) (environs map[string]string)

func NameVersion

func NameVersion(pkg string) (name, version string)

func Names

func Names(ps []*Pkg) string

func NetrcEntries

func NetrcEntries() (entries []string)

func OpenZipFile

func OpenZipFile(src string) (r *bytes.Reader, fs int64, err error)

func ParseNetrcToken

func ParseNetrcToken(token string) (github, login, pass string, err error)

func PkgSum

func PkgSum(name, version, sha1sum string, deploy bool) string

func ReadDirNames

func ReadDirNames(dirname string) (names []string)

func ReadFileNames

func ReadFileNames(dirname string) (names []string)

func Register

func Register(s *grpc.Server)

func RegisterPkgAdminServer

func RegisterPkgAdminServer(s *grpc.Server, srv PkgAdminServer)

func ReleaseURL

func ReleaseURL(name, version string) (url string)

func RemoveNetrc

func RemoveNetrc(github string) (err error)

func RunParts

func RunParts(part string, args ...string) (output string, err error)

func RunPartsDetach

func RunPartsDetach(part string, args ...string) (err error)

func SaveEnvirons

func SaveEnvirons(target string, environs map[string]string) (err error)

func Unzip

func Unzip(src string, dest string) ([]string, error)

func Versions

func Versions(name string) (versions []string)

Types

type BuildReply

type BuildReply struct {
	Pkgs                 []*Pkg   `protobuf:"bytes,1,rep,name=pkgs,proto3" json:"pkgs,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BuildReply) Descriptor

func (*BuildReply) Descriptor() ([]byte, []int)

func (*BuildReply) GetPkgs

func (m *BuildReply) GetPkgs() []*Pkg

func (*BuildReply) ProtoMessage

func (*BuildReply) ProtoMessage()

func (*BuildReply) Reset

func (m *BuildReply) Reset()

func (*BuildReply) String

func (m *BuildReply) String() string

func (*BuildReply) XXX_DiscardUnknown

func (m *BuildReply) XXX_DiscardUnknown()

func (*BuildReply) XXX_Marshal

func (m *BuildReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BuildReply) XXX_Merge

func (m *BuildReply) XXX_Merge(src proto.Message)

func (*BuildReply) XXX_Size

func (m *BuildReply) XXX_Size() int

func (*BuildReply) XXX_Unmarshal

func (m *BuildReply) XXX_Unmarshal(b []byte) error

type BuildRequest

type BuildRequest struct {
	Project              *Project `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BuildRequest) Descriptor

func (*BuildRequest) Descriptor() ([]byte, []int)

func (*BuildRequest) GetProject

func (m *BuildRequest) GetProject() *Project

func (*BuildRequest) ProtoMessage

func (*BuildRequest) ProtoMessage()

func (*BuildRequest) Reset

func (m *BuildRequest) Reset()

func (*BuildRequest) String

func (m *BuildRequest) String() string

func (*BuildRequest) XXX_DiscardUnknown

func (m *BuildRequest) XXX_DiscardUnknown()

func (*BuildRequest) XXX_Marshal

func (m *BuildRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BuildRequest) XXX_Merge

func (m *BuildRequest) XXX_Merge(src proto.Message)

func (*BuildRequest) XXX_Size

func (m *BuildRequest) XXX_Size() int

func (*BuildRequest) XXX_Unmarshal

func (m *BuildRequest) XXX_Unmarshal(b []byte) error

type Chunk

type Chunk struct {
	Data                 []byte   `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Position             int64    `protobuf:"varint,2,opt,name=position,proto3" json:"position,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Chunk) Descriptor

func (*Chunk) Descriptor() ([]byte, []int)

func (*Chunk) GetData

func (m *Chunk) GetData() []byte

func (*Chunk) GetPosition

func (m *Chunk) GetPosition() int64

func (*Chunk) ProtoMessage

func (*Chunk) ProtoMessage()

func (*Chunk) Reset

func (m *Chunk) Reset()

func (*Chunk) String

func (m *Chunk) String() string

func (*Chunk) XXX_DiscardUnknown

func (m *Chunk) XXX_DiscardUnknown()

func (*Chunk) XXX_Marshal

func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Chunk) XXX_Merge

func (m *Chunk) XXX_Merge(src proto.Message)

func (*Chunk) XXX_Size

func (m *Chunk) XXX_Size() int

func (*Chunk) XXX_Unmarshal

func (m *Chunk) XXX_Unmarshal(b []byte) error

type DownloadRequest

type DownloadRequest struct {
	Pkg                  *Pkg     `protobuf:"bytes,1,opt,name=pkg,proto3" json:"pkg,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DownloadRequest) Descriptor

func (*DownloadRequest) Descriptor() ([]byte, []int)

func (*DownloadRequest) GetPkg

func (m *DownloadRequest) GetPkg() *Pkg

func (*DownloadRequest) ProtoMessage

func (*DownloadRequest) ProtoMessage()

func (*DownloadRequest) Reset

func (m *DownloadRequest) Reset()

func (*DownloadRequest) String

func (m *DownloadRequest) String() string

func (*DownloadRequest) XXX_DiscardUnknown

func (m *DownloadRequest) XXX_DiscardUnknown()

func (*DownloadRequest) XXX_Marshal

func (m *DownloadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DownloadRequest) XXX_Merge

func (m *DownloadRequest) XXX_Merge(src proto.Message)

func (*DownloadRequest) XXX_Size

func (m *DownloadRequest) XXX_Size() int

func (*DownloadRequest) XXX_Unmarshal

func (m *DownloadRequest) XXX_Unmarshal(b []byte) error

type ListRequest

type ListRequest struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListRequest) Descriptor

func (*ListRequest) Descriptor() ([]byte, []int)

func (*ListRequest) GetName

func (m *ListRequest) GetName() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset

func (m *ListRequest) Reset()

func (*ListRequest) String

func (m *ListRequest) String() string

func (*ListRequest) XXX_DiscardUnknown

func (m *ListRequest) XXX_DiscardUnknown()

func (*ListRequest) XXX_Marshal

func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListRequest) XXX_Merge

func (m *ListRequest) XXX_Merge(src proto.Message)

func (*ListRequest) XXX_Size

func (m *ListRequest) XXX_Size() int

func (*ListRequest) XXX_Unmarshal

func (m *ListRequest) XXX_Unmarshal(b []byte) error

type Pkg

type Pkg struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version              string   `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Sha1Sum              string   `protobuf:"bytes,3,opt,name=sha1sum,proto3" json:"sha1sum,omitempty"`
	Deploy               bool     `protobuf:"varint,4,opt,name=deploy,proto3" json:"deploy,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Pkg) Descriptor

func (*Pkg) Descriptor() ([]byte, []int)

func (*Pkg) GetDeploy

func (m *Pkg) GetDeploy() bool

func (*Pkg) GetName

func (m *Pkg) GetName() string

func (*Pkg) GetSha1Sum

func (m *Pkg) GetSha1Sum() string

func (*Pkg) GetVersion

func (m *Pkg) GetVersion() string

func (*Pkg) ProtoMessage

func (*Pkg) ProtoMessage()

func (*Pkg) Reset

func (m *Pkg) Reset()

func (*Pkg) String

func (m *Pkg) String() string

func (*Pkg) XXX_DiscardUnknown

func (m *Pkg) XXX_DiscardUnknown()

func (*Pkg) XXX_Marshal

func (m *Pkg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Pkg) XXX_Merge

func (m *Pkg) XXX_Merge(src proto.Message)

func (*Pkg) XXX_Size

func (m *Pkg) XXX_Size() int

func (*Pkg) XXX_Unmarshal

func (m *Pkg) XXX_Unmarshal(b []byte) error

type PkgAdminClient

type PkgAdminClient interface {
	Upload(ctx context.Context, opts ...grpc.CallOption) (PkgAdmin_UploadClient, error)
	Remove(ctx context.Context, in *RemoveRequest, opts ...grpc.CallOption) (*RemoveReply, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (PkgAdmin_ListClient, error)
	Build(ctx context.Context, in *BuildRequest, opts ...grpc.CallOption) (*BuildReply, error)
	Download(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (PkgAdmin_DownloadClient, error)
}

PkgAdminClient is the client API for PkgAdmin service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewPkgAdminClient

func NewPkgAdminClient(cc *grpc.ClientConn) PkgAdminClient

type PkgAdminServer

PkgAdminServer is the server API for PkgAdmin service.

type PkgAdmin_DownloadClient

type PkgAdmin_DownloadClient interface {
	Recv() (*PkgChunk, error)
	grpc.ClientStream
}

type PkgAdmin_DownloadServer

type PkgAdmin_DownloadServer interface {
	Send(*PkgChunk) error
	grpc.ServerStream
}

type PkgAdmin_ListClient

type PkgAdmin_ListClient interface {
	Recv() (*Pkg, error)
	grpc.ClientStream
}

type PkgAdmin_ListServer

type PkgAdmin_ListServer interface {
	Send(*Pkg) error
	grpc.ServerStream
}

type PkgAdmin_UploadClient

type PkgAdmin_UploadClient interface {
	Send(*PkgChunk) error
	CloseAndRecv() (*UploadReply, error)
	grpc.ClientStream
}

type PkgAdmin_UploadServer

type PkgAdmin_UploadServer interface {
	SendAndClose(*UploadReply) error
	Recv() (*PkgChunk, error)
	grpc.ServerStream
}

type PkgChunk

type PkgChunk struct {
	Pkg                  *Pkg     `protobuf:"bytes,1,opt,name=pkg,proto3" json:"pkg,omitempty"`
	Chunk                *Chunk   `protobuf:"bytes,2,opt,name=chunk,proto3" json:"chunk,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PkgChunk) Descriptor

func (*PkgChunk) Descriptor() ([]byte, []int)

func (*PkgChunk) GetChunk

func (m *PkgChunk) GetChunk() *Chunk

func (*PkgChunk) GetPkg

func (m *PkgChunk) GetPkg() *Pkg

func (*PkgChunk) ProtoMessage

func (*PkgChunk) ProtoMessage()

func (*PkgChunk) Reset

func (m *PkgChunk) Reset()

func (*PkgChunk) String

func (m *PkgChunk) String() string

func (*PkgChunk) XXX_DiscardUnknown

func (m *PkgChunk) XXX_DiscardUnknown()

func (*PkgChunk) XXX_Marshal

func (m *PkgChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PkgChunk) XXX_Merge

func (m *PkgChunk) XXX_Merge(src proto.Message)

func (*PkgChunk) XXX_Size

func (m *PkgChunk) XXX_Size() int

func (*PkgChunk) XXX_Unmarshal

func (m *PkgChunk) XXX_Unmarshal(b []byte) error

type Project

type Project struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version              string   `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Project) Build

func (p *Project) Build(url string) (pkgs []*Pkg, err error)

func (*Project) Descriptor

func (*Project) Descriptor() ([]byte, []int)

func (*Project) GetName

func (m *Project) GetName() string

func (*Project) GetVersion

func (m *Project) GetVersion() string

func (*Project) ProtoMessage

func (*Project) ProtoMessage()

func (*Project) Reset

func (m *Project) Reset()

func (*Project) String

func (m *Project) String() string

func (*Project) XXX_DiscardUnknown

func (m *Project) XXX_DiscardUnknown()

func (*Project) XXX_Marshal

func (m *Project) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Project) XXX_Merge

func (m *Project) XXX_Merge(src proto.Message)

func (*Project) XXX_Size

func (m *Project) XXX_Size() int

func (*Project) XXX_Unmarshal

func (m *Project) XXX_Unmarshal(b []byte) error

type RemoveReply

type RemoveReply struct {
	Pkg                  *Pkg     `protobuf:"bytes,1,opt,name=pkg,proto3" json:"pkg,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RemoveReply) Descriptor

func (*RemoveReply) Descriptor() ([]byte, []int)

func (*RemoveReply) GetPkg

func (m *RemoveReply) GetPkg() *Pkg

func (*RemoveReply) ProtoMessage

func (*RemoveReply) ProtoMessage()

func (*RemoveReply) Reset

func (m *RemoveReply) Reset()

func (*RemoveReply) String

func (m *RemoveReply) String() string

func (*RemoveReply) XXX_DiscardUnknown

func (m *RemoveReply) XXX_DiscardUnknown()

func (*RemoveReply) XXX_Marshal

func (m *RemoveReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoveReply) XXX_Merge

func (m *RemoveReply) XXX_Merge(src proto.Message)

func (*RemoveReply) XXX_Size

func (m *RemoveReply) XXX_Size() int

func (*RemoveReply) XXX_Unmarshal

func (m *RemoveReply) XXX_Unmarshal(b []byte) error

type RemoveRequest

type RemoveRequest struct {
	Pkg                  *Pkg     `protobuf:"bytes,1,opt,name=pkg,proto3" json:"pkg,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RemoveRequest) Descriptor

func (*RemoveRequest) Descriptor() ([]byte, []int)

func (*RemoveRequest) GetPkg

func (m *RemoveRequest) GetPkg() *Pkg

func (*RemoveRequest) ProtoMessage

func (*RemoveRequest) ProtoMessage()

func (*RemoveRequest) Reset

func (m *RemoveRequest) Reset()

func (*RemoveRequest) String

func (m *RemoveRequest) String() string

func (*RemoveRequest) XXX_DiscardUnknown

func (m *RemoveRequest) XXX_DiscardUnknown()

func (*RemoveRequest) XXX_Marshal

func (m *RemoveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RemoveRequest) XXX_Merge

func (m *RemoveRequest) XXX_Merge(src proto.Message)

func (*RemoveRequest) XXX_Size

func (m *RemoveRequest) XXX_Size() int

func (*RemoveRequest) XXX_Unmarshal

func (m *RemoveRequest) XXX_Unmarshal(b []byte) error

type Setting

type Setting struct {
	Github               string   `protobuf:"bytes,1,opt,name=github,proto3" json:"github,omitempty"`
	Login                string   `protobuf:"bytes,2,opt,name=login,proto3" json:"login,omitempty"`
	Token                string   `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Setting) Descriptor

func (*Setting) Descriptor() ([]byte, []int)

func (*Setting) GetGithub

func (m *Setting) GetGithub() string

func (*Setting) GetLogin

func (m *Setting) GetLogin() string

func (*Setting) GetToken

func (m *Setting) GetToken() string

func (*Setting) ProtoMessage

func (*Setting) ProtoMessage()

func (*Setting) Reset

func (m *Setting) Reset()

func (*Setting) String

func (m *Setting) String() string

func (*Setting) XXX_DiscardUnknown

func (m *Setting) XXX_DiscardUnknown()

func (*Setting) XXX_Marshal

func (m *Setting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Setting) XXX_Merge

func (m *Setting) XXX_Merge(src proto.Message)

func (*Setting) XXX_Size

func (m *Setting) XXX_Size() int

func (*Setting) XXX_Unmarshal

func (m *Setting) XXX_Unmarshal(b []byte) error

type Strings

type Strings []string

func (Strings) Append

func (ss Strings) Append(strs ...string) Strings

func (Strings) Contains

func (ss Strings) Contains(want string) bool

func (Strings) Equal

func (ss Strings) Equal(wants Strings) bool

type TreeR

type TreeR struct {
	*toml.Tree
	// contains filtered or unexported fields
}

func LoadContentR

func LoadContentR(content string) (tr *TreeR)

func LoadFileR

func LoadFileR(p string) (tr *TreeR)

func LoadPkgSum

func LoadPkgSum(name, version string) (tr *TreeR)

func LoadRelease

func LoadRelease(name, version string) (tr *TreeR)

func LoadReleasePkg

func LoadReleasePkg(name string, pkg string) (tr *TreeR)

func LoadTarget

func LoadTarget(target string) (tr *TreeR)

func (*TreeR) GetBool

func (tr *TreeR) GetBool(name ...string) (value bool)

func (*TreeR) GetDeploy

func (tr *TreeR) GetDeploy() (deploy bool)

func (*TreeR) GetInt

func (tr *TreeR) GetInt(name ...string) (value int)

func (*TreeR) GetPkg

func (tr *TreeR) GetPkg(name string) (pkg *Pkg)

func (*TreeR) GetPkgs

func (tr *TreeR) GetPkgs() (ps []*Pkg)

func (*TreeR) GetString

func (tr *TreeR) GetString(name ...string) (value string)

func (*TreeR) NotFound

func (tr *TreeR) NotFound() bool

func (*TreeR) Remove

func (tr *TreeR) Remove() (err error)

type UnimplementedPkgAdminServer

type UnimplementedPkgAdminServer struct {
}

UnimplementedPkgAdminServer can be embedded to have forward compatible implementations.

func (*UnimplementedPkgAdminServer) Build

func (*UnimplementedPkgAdminServer) Download

func (*UnimplementedPkgAdminServer) List

func (*UnimplementedPkgAdminServer) Remove

func (*UnimplementedPkgAdminServer) Upload

type UploadReply

type UploadReply struct {
	Pkg                  *Pkg     `protobuf:"bytes,1,opt,name=pkg,proto3" json:"pkg,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UploadReply) Descriptor

func (*UploadReply) Descriptor() ([]byte, []int)

func (*UploadReply) GetPkg

func (m *UploadReply) GetPkg() *Pkg

func (*UploadReply) ProtoMessage

func (*UploadReply) ProtoMessage()

func (*UploadReply) Reset

func (m *UploadReply) Reset()

func (*UploadReply) String

func (m *UploadReply) String() string

func (*UploadReply) XXX_DiscardUnknown

func (m *UploadReply) XXX_DiscardUnknown()

func (*UploadReply) XXX_Marshal

func (m *UploadReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UploadReply) XXX_Merge

func (m *UploadReply) XXX_Merge(src proto.Message)

func (*UploadReply) XXX_Size

func (m *UploadReply) XXX_Size() int

func (*UploadReply) XXX_Unmarshal

func (m *UploadReply) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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