repo stringlengths 5 67 | path stringlengths 4 218 | func_name stringlengths 0 151 | original_string stringlengths 52 373k | language stringclasses 6
values | code stringlengths 52 373k | code_tokens listlengths 10 512 | docstring stringlengths 3 47.2k | docstring_tokens listlengths 3 234 | sha stringlengths 40 40 | url stringlengths 85 339 | partition stringclasses 3
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
pachyderm/pachyderm | src/server/pkg/hashtree/db.go | PutDir | func (o *Ordered) PutDir(path string) {
path = clean(path)
if path == "" {
return
}
nodeProto := &NodeProto{
Name: base(path),
DirNode: &DirectoryNodeProto{},
}
o.putDir(path, nodeProto)
} | go | func (o *Ordered) PutDir(path string) {
path = clean(path)
if path == "" {
return
}
nodeProto := &NodeProto{
Name: base(path),
DirNode: &DirectoryNodeProto{},
}
o.putDir(path, nodeProto)
} | [
"func",
"(",
"o",
"*",
"Ordered",
")",
"PutDir",
"(",
"path",
"string",
")",
"{",
"path",
"=",
"clean",
"(",
"path",
")",
"\n",
"if",
"path",
"==",
"\"\"",
"{",
"return",
"\n",
"}",
"\n",
"nodeProto",
":=",
"&",
"NodeProto",
"{",
"Name",
":",
"ba... | // PutDir puts a directory in the hashtree. | [
"PutDir",
"puts",
"a",
"directory",
"in",
"the",
"hashtree",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1664-L1674 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/db.go | Serialize | func (o *Ordered) Serialize(_w io.Writer) error {
w := NewWriter(_w)
// Unwind directory stack
for len(o.dirStack) > 1 {
child := o.dirStack[len(o.dirStack)-1]
child.nodeProto.Hash = child.hash.Sum(nil)
o.dirStack = o.dirStack[:len(o.dirStack)-1]
parent := o.dirStack[len(o.dirStack)-1]
parent.hash.Write([]... | go | func (o *Ordered) Serialize(_w io.Writer) error {
w := NewWriter(_w)
// Unwind directory stack
for len(o.dirStack) > 1 {
child := o.dirStack[len(o.dirStack)-1]
child.nodeProto.Hash = child.hash.Sum(nil)
o.dirStack = o.dirStack[:len(o.dirStack)-1]
parent := o.dirStack[len(o.dirStack)-1]
parent.hash.Write([]... | [
"func",
"(",
"o",
"*",
"Ordered",
")",
"Serialize",
"(",
"_w",
"io",
".",
"Writer",
")",
"error",
"{",
"w",
":=",
"NewWriter",
"(",
"_w",
")",
"\n",
"for",
"len",
"(",
"o",
".",
"dirStack",
")",
">",
"1",
"{",
"child",
":=",
"o",
".",
"dirStack... | // Serialize serializes an ordered hashtree. | [
"Serialize",
"serializes",
"an",
"ordered",
"hashtree",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1725-L1746 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/db.go | NewUnordered | func NewUnordered(root string) *Unordered {
return &Unordered{
fs: make(map[string]*NodeProto),
root: clean(root),
}
} | go | func NewUnordered(root string) *Unordered {
return &Unordered{
fs: make(map[string]*NodeProto),
root: clean(root),
}
} | [
"func",
"NewUnordered",
"(",
"root",
"string",
")",
"*",
"Unordered",
"{",
"return",
"&",
"Unordered",
"{",
"fs",
":",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"NodeProto",
")",
",",
"root",
":",
"clean",
"(",
"root",
")",
",",
"}",
"\n",
"}"
] | // NewUnordered creates a new unordered hashtree. | [
"NewUnordered",
"creates",
"a",
"new",
"unordered",
"hashtree",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1755-L1760 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/db.go | Ordered | func (u *Unordered) Ordered() *Ordered {
paths := make([]string, len(u.fs))
i := 0
for path := range u.fs {
paths[i] = path
i++
}
sort.Strings(paths)
o := NewOrdered("")
for i := 1; i < len(paths); i++ {
path := paths[i]
n := u.fs[path]
if n.DirNode != nil {
o.putDir(path, n)
} else {
o.putFile... | go | func (u *Unordered) Ordered() *Ordered {
paths := make([]string, len(u.fs))
i := 0
for path := range u.fs {
paths[i] = path
i++
}
sort.Strings(paths)
o := NewOrdered("")
for i := 1; i < len(paths); i++ {
path := paths[i]
n := u.fs[path]
if n.DirNode != nil {
o.putDir(path, n)
} else {
o.putFile... | [
"func",
"(",
"u",
"*",
"Unordered",
")",
"Ordered",
"(",
")",
"*",
"Ordered",
"{",
"paths",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"u",
".",
"fs",
")",
")",
"\n",
"i",
":=",
"0",
"\n",
"for",
"path",
":=",
"range",
"u",
".",
... | // Ordered converts an unordered hashtree into an ordered hashtree. | [
"Ordered",
"converts",
"an",
"unordered",
"hashtree",
"into",
"an",
"ordered",
"hashtree",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/db.go#L1794-L1813 | test |
pachyderm/pachyderm | src/plugin/vault/pachyderm/revoke.go | revokeUserCredentials | func revokeUserCredentials(ctx context.Context, pachdAddress string, userToken string, adminToken string) error {
// Setup a single use client w the given admin token / address
client, err := pclient.NewFromAddress(pachdAddress)
if err != nil {
return err
}
defer client.Close() // avoid leaking connections
cli... | go | func revokeUserCredentials(ctx context.Context, pachdAddress string, userToken string, adminToken string) error {
// Setup a single use client w the given admin token / address
client, err := pclient.NewFromAddress(pachdAddress)
if err != nil {
return err
}
defer client.Close() // avoid leaking connections
cli... | [
"func",
"revokeUserCredentials",
"(",
"ctx",
"context",
".",
"Context",
",",
"pachdAddress",
"string",
",",
"userToken",
"string",
",",
"adminToken",
"string",
")",
"error",
"{",
"client",
",",
"err",
":=",
"pclient",
".",
"NewFromAddress",
"(",
"pachdAddress",
... | // revokeUserCredentials revokes the Pachyderm authentication token 'userToken'
// using the vault plugin's Admin credentials. | [
"revokeUserCredentials",
"revokes",
"the",
"Pachyderm",
"authentication",
"token",
"userToken",
"using",
"the",
"vault",
"plugin",
"s",
"Admin",
"credentials",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/plugin/vault/pachyderm/revoke.go#L57-L71 | test |
pachyderm/pachyderm | src/client/version/api_server.go | NewAPIServer | func NewAPIServer(version *pb.Version, options APIServerOptions) pb.APIServer {
return newAPIServer(version, options)
} | go | func NewAPIServer(version *pb.Version, options APIServerOptions) pb.APIServer {
return newAPIServer(version, options)
} | [
"func",
"NewAPIServer",
"(",
"version",
"*",
"pb",
".",
"Version",
",",
"options",
"APIServerOptions",
")",
"pb",
".",
"APIServer",
"{",
"return",
"newAPIServer",
"(",
"version",
",",
"options",
")",
"\n",
"}"
] | // NewAPIServer creates a new APIServer for the given Version. | [
"NewAPIServer",
"creates",
"a",
"new",
"APIServer",
"for",
"the",
"given",
"Version",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/version/api_server.go#L32-L34 | test |
pachyderm/pachyderm | src/client/version/api_server.go | String | func String(v *pb.Version) string {
return fmt.Sprintf("%d.%d.%d%s", v.Major, v.Minor, v.Micro, v.Additional)
} | go | func String(v *pb.Version) string {
return fmt.Sprintf("%d.%d.%d%s", v.Major, v.Minor, v.Micro, v.Additional)
} | [
"func",
"String",
"(",
"v",
"*",
"pb",
".",
"Version",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"%d.%d.%d%s\"",
",",
"v",
".",
"Major",
",",
"v",
".",
"Minor",
",",
"v",
".",
"Micro",
",",
"v",
".",
"Additional",
")",
"\n",
"}"... | // String returns a string representation of the Version. | [
"String",
"returns",
"a",
"string",
"representation",
"of",
"the",
"Version",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/version/api_server.go#L45-L47 | test |
pachyderm/pachyderm | src/server/cmd/worker/main.go | getPipelineInfo | func getPipelineInfo(pachClient *client.APIClient, env *serviceenv.ServiceEnv) (*pps.PipelineInfo, error) {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
resp, err := env.GetEtcdClient().Get(ctx, path.Join(env.PPSEtcdPrefix, "pipelines", env.PPSPipelineName))
if err != nil ... | go | func getPipelineInfo(pachClient *client.APIClient, env *serviceenv.ServiceEnv) (*pps.PipelineInfo, error) {
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
resp, err := env.GetEtcdClient().Get(ctx, path.Join(env.PPSEtcdPrefix, "pipelines", env.PPSPipelineName))
if err != nil ... | [
"func",
"getPipelineInfo",
"(",
"pachClient",
"*",
"client",
".",
"APIClient",
",",
"env",
"*",
"serviceenv",
".",
"ServiceEnv",
")",
"(",
"*",
"pps",
".",
"PipelineInfo",
",",
"error",
")",
"{",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
... | // getPipelineInfo gets the PipelineInfo proto describing the pipeline that this
// worker is part of.
// getPipelineInfo has the side effect of adding auth to the passed pachClient
// which is necessary to get the PipelineInfo from pfs. | [
"getPipelineInfo",
"gets",
"the",
"PipelineInfo",
"proto",
"describing",
"the",
"pipeline",
"that",
"this",
"worker",
"is",
"part",
"of",
".",
"getPipelineInfo",
"has",
"the",
"side",
"effect",
"of",
"adding",
"auth",
"to",
"the",
"passed",
"pachClient",
"which"... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/cmd/worker/main.go#L104-L125 | test |
pachyderm/pachyderm | src/server/pkg/hashtree/sorted_list.go | removeStr | func removeStr(ss *[]string, s string) bool {
idx := sort.SearchStrings(*ss, s)
if idx == len(*ss) {
return false
}
copy((*ss)[idx:], (*ss)[idx+1:])
*ss = (*ss)[:len(*ss)-1]
return true
} | go | func removeStr(ss *[]string, s string) bool {
idx := sort.SearchStrings(*ss, s)
if idx == len(*ss) {
return false
}
copy((*ss)[idx:], (*ss)[idx+1:])
*ss = (*ss)[:len(*ss)-1]
return true
} | [
"func",
"removeStr",
"(",
"ss",
"*",
"[",
"]",
"string",
",",
"s",
"string",
")",
"bool",
"{",
"idx",
":=",
"sort",
".",
"SearchStrings",
"(",
"*",
"ss",
",",
"s",
")",
"\n",
"if",
"idx",
"==",
"len",
"(",
"*",
"ss",
")",
"{",
"return",
"false"... | // removeStr removes 's' from 'ss', preserving the sorted order of 'ss' (for
// removing child strings from DirectoryNodes. | [
"removeStr",
"removes",
"s",
"from",
"ss",
"preserving",
"the",
"sorted",
"order",
"of",
"ss",
"(",
"for",
"removing",
"child",
"strings",
"from",
"DirectoryNodes",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/hashtree/sorted_list.go#L54-L62 | test |
pachyderm/pachyderm | src/server/pkg/cert/cert.go | PublicCertToPEM | func PublicCertToPEM(cert *tls.Certificate) []byte {
return pem.EncodeToMemory(&pem.Block{
Type: "CERTIFICATE",
Bytes: cert.Certificate[0],
})
} | go | func PublicCertToPEM(cert *tls.Certificate) []byte {
return pem.EncodeToMemory(&pem.Block{
Type: "CERTIFICATE",
Bytes: cert.Certificate[0],
})
} | [
"func",
"PublicCertToPEM",
"(",
"cert",
"*",
"tls",
".",
"Certificate",
")",
"[",
"]",
"byte",
"{",
"return",
"pem",
".",
"EncodeToMemory",
"(",
"&",
"pem",
".",
"Block",
"{",
"Type",
":",
"\"CERTIFICATE\"",
",",
"Bytes",
":",
"cert",
".",
"Certificate",... | // PublicCertToPEM serializes the public x509 cert in 'cert' to a PEM-formatted
// block | [
"PublicCertToPEM",
"serializes",
"the",
"public",
"x509",
"cert",
"in",
"cert",
"to",
"a",
"PEM",
"-",
"formatted",
"block"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cert/cert.go#L29-L34 | test |
pachyderm/pachyderm | src/server/pkg/cert/cert.go | GenerateSelfSignedCert | func GenerateSelfSignedCert(address string, name *pkix.Name, ipAddresses ...string) (*tls.Certificate, error) {
// Generate Subject Distinguished Name
if name == nil {
name = &pkix.Name{}
}
switch {
case address == "" && name.CommonName == "":
return nil, errors.New("must set either \"address\" or \"name.Commo... | go | func GenerateSelfSignedCert(address string, name *pkix.Name, ipAddresses ...string) (*tls.Certificate, error) {
// Generate Subject Distinguished Name
if name == nil {
name = &pkix.Name{}
}
switch {
case address == "" && name.CommonName == "":
return nil, errors.New("must set either \"address\" or \"name.Commo... | [
"func",
"GenerateSelfSignedCert",
"(",
"address",
"string",
",",
"name",
"*",
"pkix",
".",
"Name",
",",
"ipAddresses",
"...",
"string",
")",
"(",
"*",
"tls",
".",
"Certificate",
",",
"error",
")",
"{",
"if",
"name",
"==",
"nil",
"{",
"name",
"=",
"&",
... | // GenerateSelfSignedCert generates a self-signed TLS cert for the domain name
// 'address', with a private key. Other attributes of the subject can be set in
// 'name' and ip addresses can be set in 'ipAddresses' | [
"GenerateSelfSignedCert",
"generates",
"a",
"self",
"-",
"signed",
"TLS",
"cert",
"for",
"the",
"domain",
"name",
"address",
"with",
"a",
"private",
"key",
".",
"Other",
"attributes",
"of",
"the",
"subject",
"can",
"be",
"set",
"in",
"name",
"and",
"ip",
"... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cert/cert.go#L54-L124 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | ActivateCmd | func ActivateCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
var initialAdmin string
activate := &cobra.Command{
Short: "Activate Pachyderm's auth system",
Long: `
Activate Pachyderm's auth system, and restrict access to existing data to the
user running the command (or the argument to --initial-admin), w... | go | func ActivateCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
var initialAdmin string
activate := &cobra.Command{
Short: "Activate Pachyderm's auth system",
Long: `
Activate Pachyderm's auth system, and restrict access to existing data to the
user running the command (or the argument to --initial-admin), w... | [
"func",
"ActivateCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"var",
"initialAdmin",
"string",
"\n",
"activate",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Short",
":",
"\"Activate Pachyderm's auth system\"... | // ActivateCmd returns a cobra.Command to activate Pachyderm's auth system | [
"ActivateCmd",
"returns",
"a",
"cobra",
".",
"Command",
"to",
"activate",
"Pachyderm",
"s",
"auth",
"system"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L54-L108 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | DeactivateCmd | func DeactivateCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
deactivate := &cobra.Command{
Short: "Delete all ACLs, tokens, and admins, and deactivate Pachyderm auth",
Long: "Deactivate Pachyderm's auth system, which will delete ALL auth " +
"tokens, ACLs and admins, and expose all data in the cluster... | go | func DeactivateCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
deactivate := &cobra.Command{
Short: "Delete all ACLs, tokens, and admins, and deactivate Pachyderm auth",
Long: "Deactivate Pachyderm's auth system, which will delete ALL auth " +
"tokens, ACLs and admins, and expose all data in the cluster... | [
"func",
"DeactivateCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"deactivate",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Short",
":",
"\"Delete all ACLs, tokens, and admins, and deactivate Pachyderm auth\"",
",",... | // DeactivateCmd returns a cobra.Command to delete all ACLs, tokens, and admins,
// deactivating Pachyderm's auth system | [
"DeactivateCmd",
"returns",
"a",
"cobra",
".",
"Command",
"to",
"delete",
"all",
"ACLs",
"tokens",
"and",
"admins",
"deactivating",
"Pachyderm",
"s",
"auth",
"system"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L112-L135 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | LoginCmd | func LoginCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
var useOTP bool
login := &cobra.Command{
Short: "Log in to Pachyderm",
Long: "Login to Pachyderm. Any resources that have been restricted to " +
"the account you have with your ID provider (e.g. GitHub, Okta) " +
"account will subsequently be... | go | func LoginCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
var useOTP bool
login := &cobra.Command{
Short: "Log in to Pachyderm",
Long: "Login to Pachyderm. Any resources that have been restricted to " +
"the account you have with your ID provider (e.g. GitHub, Okta) " +
"account will subsequently be... | [
"func",
"LoginCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"var",
"useOTP",
"bool",
"\n",
"login",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Short",
":",
"\"Log in to Pachyderm\"",
",",
"Long",
":",
... | // LoginCmd returns a cobra.Command to login to a Pachyderm cluster with your
// GitHub account. Any resources that have been restricted to the email address
// registered with your GitHub account will subsequently be accessible. | [
"LoginCmd",
"returns",
"a",
"cobra",
".",
"Command",
"to",
"login",
"to",
"a",
"Pachyderm",
"cluster",
"with",
"your",
"GitHub",
"account",
".",
"Any",
"resources",
"that",
"have",
"been",
"restricted",
"to",
"the",
"email",
"address",
"registered",
"with",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L140-L197 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | LogoutCmd | func LogoutCmd() *cobra.Command {
logout := &cobra.Command{
Short: "Log out of Pachyderm by deleting your local credential",
Long: "Log out of Pachyderm by deleting your local credential. Note that " +
"it's not necessary to log out before logging in with another account " +
"(simply run 'pachctl auth login'... | go | func LogoutCmd() *cobra.Command {
logout := &cobra.Command{
Short: "Log out of Pachyderm by deleting your local credential",
Long: "Log out of Pachyderm by deleting your local credential. Note that " +
"it's not necessary to log out before logging in with another account " +
"(simply run 'pachctl auth login'... | [
"func",
"LogoutCmd",
"(",
")",
"*",
"cobra",
".",
"Command",
"{",
"logout",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Short",
":",
"\"Log out of Pachyderm by deleting your local credential\"",
",",
"Long",
":",
"\"Log out of Pachyderm by deleting your local credential. No... | // LogoutCmd returns a cobra.Command that deletes your local Pachyderm
// credential, logging you out of your cluster. Note that this is not necessary
// to do before logging in as another user, but is useful for testing. | [
"LogoutCmd",
"returns",
"a",
"cobra",
".",
"Command",
"that",
"deletes",
"your",
"local",
"Pachyderm",
"credential",
"logging",
"you",
"out",
"of",
"your",
"cluster",
".",
"Note",
"that",
"this",
"is",
"not",
"necessary",
"to",
"do",
"before",
"logging",
"in... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L202-L223 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | WhoamiCmd | func WhoamiCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
whoami := &cobra.Command{
Short: "Print your Pachyderm identity",
Long: "Print your Pachyderm identity.",
Run: cmdutil.Run(func([]string) error {
c, err := client.NewOnUserMachine(!*noMetrics, !*noPortForwarding, "user")
if err != nil {
... | go | func WhoamiCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
whoami := &cobra.Command{
Short: "Print your Pachyderm identity",
Long: "Print your Pachyderm identity.",
Run: cmdutil.Run(func([]string) error {
c, err := client.NewOnUserMachine(!*noMetrics, !*noPortForwarding, "user")
if err != nil {
... | [
"func",
"WhoamiCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"whoami",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Short",
":",
"\"Print your Pachyderm identity\"",
",",
"Long",
":",
"\"Print your Pachyderm i... | // WhoamiCmd returns a cobra.Command that deletes your local Pachyderm
// credential, logging you out of your cluster. Note that this is not necessary
// to do before logging in as another user, but is useful for testing. | [
"WhoamiCmd",
"returns",
"a",
"cobra",
".",
"Command",
"that",
"deletes",
"your",
"local",
"Pachyderm",
"credential",
"logging",
"you",
"out",
"of",
"your",
"cluster",
".",
"Note",
"that",
"this",
"is",
"not",
"necessary",
"to",
"do",
"before",
"logging",
"in... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L228-L253 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | CheckCmd | func CheckCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
check := &cobra.Command{
Use: "{{alias}} (none|reader|writer|owner) <repo>",
Short: "Check whether you have reader/writer/etc-level access to 'repo'",
Long: "Check whether you have reader/writer/etc-level access to 'repo'. " +
"For example, '... | go | func CheckCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
check := &cobra.Command{
Use: "{{alias}} (none|reader|writer|owner) <repo>",
Short: "Check whether you have reader/writer/etc-level access to 'repo'",
Long: "Check whether you have reader/writer/etc-level access to 'repo'. " +
"For example, '... | [
"func",
"CheckCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"check",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Use",
":",
"\"{{alias}} (none|reader|writer|owner) <repo>\"",
",",
"Short",
":",
"\"Check wheth... | // CheckCmd returns a cobra command that sends an "Authorize" RPC to Pachd, to
// determine whether the specified user has access to the specified repo. | [
"CheckCmd",
"returns",
"a",
"cobra",
"command",
"that",
"sends",
"an",
"Authorize",
"RPC",
"to",
"Pachd",
"to",
"determine",
"whether",
"the",
"specified",
"user",
"has",
"access",
"to",
"the",
"specified",
"repo",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L257-L290 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | GetCmd | func GetCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
get := &cobra.Command{
Use: "{{alias}} [<username>] <repo>",
Short: "Get the ACL for 'repo' or the access that 'username' has to 'repo'",
Long: "Get the ACL for 'repo' or the access that 'username' has to " +
"'repo'. For example, 'pachctl auth... | go | func GetCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
get := &cobra.Command{
Use: "{{alias}} [<username>] <repo>",
Short: "Get the ACL for 'repo' or the access that 'username' has to 'repo'",
Long: "Get the ACL for 'repo' or the access that 'username' has to " +
"'repo'. For example, 'pachctl auth... | [
"func",
"GetCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"get",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Use",
":",
"\"{{alias}} [<username>] <repo>\"",
",",
"Short",
":",
"\"Get the ACL for 'repo' or the... | // GetCmd returns a cobra command that gets either the ACL for a Pachyderm
// repo or another user's scope of access to that repo | [
"GetCmd",
"returns",
"a",
"cobra",
"command",
"that",
"gets",
"either",
"the",
"ACL",
"for",
"a",
"Pachyderm",
"repo",
"or",
"another",
"user",
"s",
"scope",
"of",
"access",
"to",
"that",
"repo"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L294-L337 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | SetScopeCmd | func SetScopeCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
setScope := &cobra.Command{
Use: "{{alias}} <username> (none|reader|writer|owner) <repo>",
Short: "Set the scope of access that 'username' has to 'repo'",
Long: "Set the scope of access that 'username' has to 'repo'. For " +
"example, 'pac... | go | func SetScopeCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
setScope := &cobra.Command{
Use: "{{alias}} <username> (none|reader|writer|owner) <repo>",
Short: "Set the scope of access that 'username' has to 'repo'",
Long: "Set the scope of access that 'username' has to 'repo'. For " +
"example, 'pac... | [
"func",
"SetScopeCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"setScope",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Use",
":",
"\"{{alias}} <username> (none|reader|writer|owner) <repo>\"",
",",
"Short",
":",... | // SetScopeCmd returns a cobra command that lets a user set the level of access
// that another user has to a repo | [
"SetScopeCmd",
"returns",
"a",
"cobra",
"command",
"that",
"lets",
"a",
"user",
"set",
"the",
"level",
"of",
"access",
"that",
"another",
"user",
"has",
"to",
"a",
"repo"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L341-L373 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | ListAdminsCmd | func ListAdminsCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
listAdmins := &cobra.Command{
Short: "List the current cluster admins",
Long: "List the current cluster admins",
Run: cmdutil.Run(func([]string) error {
c, err := client.NewOnUserMachine(!*noMetrics, !*noPortForwarding, "user")
if err ... | go | func ListAdminsCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
listAdmins := &cobra.Command{
Short: "List the current cluster admins",
Long: "List the current cluster admins",
Run: cmdutil.Run(func([]string) error {
c, err := client.NewOnUserMachine(!*noMetrics, !*noPortForwarding, "user")
if err ... | [
"func",
"ListAdminsCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"listAdmins",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Short",
":",
"\"List the current cluster admins\"",
",",
"Long",
":",
"\"List the cur... | // ListAdminsCmd returns a cobra command that lists the current cluster admins | [
"ListAdminsCmd",
"returns",
"a",
"cobra",
"command",
"that",
"lists",
"the",
"current",
"cluster",
"admins"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L376-L397 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | ModifyAdminsCmd | func ModifyAdminsCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
var add []string
var remove []string
modifyAdmins := &cobra.Command{
Short: "Modify the current cluster admins",
Long: "Modify the current cluster admins. --add accepts a comma-" +
"separated list of users to grant admin status, and --re... | go | func ModifyAdminsCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
var add []string
var remove []string
modifyAdmins := &cobra.Command{
Short: "Modify the current cluster admins",
Long: "Modify the current cluster admins. --add accepts a comma-" +
"separated list of users to grant admin status, and --re... | [
"func",
"ModifyAdminsCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"var",
"add",
"[",
"]",
"string",
"\n",
"var",
"remove",
"[",
"]",
"string",
"\n",
"modifyAdmins",
":=",
"&",
"cobra",
".",
"Comman... | // ModifyAdminsCmd returns a cobra command that modifies the set of current
// cluster admins | [
"ModifyAdminsCmd",
"returns",
"a",
"cobra",
"command",
"that",
"modifies",
"the",
"set",
"of",
"current",
"cluster",
"admins"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L401-L432 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | GetAuthTokenCmd | func GetAuthTokenCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
var quiet bool
getAuthToken := &cobra.Command{
Use: "{{alias}} <username>",
Short: "Get an auth token that authenticates the holder as \"username\"",
Long: "Get an auth token that authenticates the holder as \"username\"; " +
"this ca... | go | func GetAuthTokenCmd(noMetrics, noPortForwarding *bool) *cobra.Command {
var quiet bool
getAuthToken := &cobra.Command{
Use: "{{alias}} <username>",
Short: "Get an auth token that authenticates the holder as \"username\"",
Long: "Get an auth token that authenticates the holder as \"username\"; " +
"this ca... | [
"func",
"GetAuthTokenCmd",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"*",
"cobra",
".",
"Command",
"{",
"var",
"quiet",
"bool",
"\n",
"getAuthToken",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Use",
":",
"\"{{alias}} <username>\"",
",",
"Sh... | // GetAuthTokenCmd returns a cobra command that lets a user get a pachyderm
// token on behalf of themselves or another user | [
"GetAuthTokenCmd",
"returns",
"a",
"cobra",
"command",
"that",
"lets",
"a",
"user",
"get",
"a",
"pachyderm",
"token",
"on",
"behalf",
"of",
"themselves",
"or",
"another",
"user"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L436-L468 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | UseAuthTokenCmd | func UseAuthTokenCmd() *cobra.Command {
useAuthToken := &cobra.Command{
Short: "Read a Pachyderm auth token from stdin, and write it to the " +
"current user's Pachyderm config file",
Long: "Read a Pachyderm auth token from stdin, and write it to the " +
"current user's Pachyderm config file",
Run: cmdutil... | go | func UseAuthTokenCmd() *cobra.Command {
useAuthToken := &cobra.Command{
Short: "Read a Pachyderm auth token from stdin, and write it to the " +
"current user's Pachyderm config file",
Long: "Read a Pachyderm auth token from stdin, and write it to the " +
"current user's Pachyderm config file",
Run: cmdutil... | [
"func",
"UseAuthTokenCmd",
"(",
")",
"*",
"cobra",
".",
"Command",
"{",
"useAuthToken",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Short",
":",
"\"Read a Pachyderm auth token from stdin, and write it to the \"",
"+",
"\"current user's Pachyderm config file\"",
",",
"Long",... | // UseAuthTokenCmd returns a cobra command that lets a user get a pachyderm
// token on behalf of themselves or another user | [
"UseAuthTokenCmd",
"returns",
"a",
"cobra",
"command",
"that",
"lets",
"a",
"user",
"get",
"a",
"pachyderm",
"token",
"on",
"behalf",
"of",
"themselves",
"or",
"another",
"user"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L472-L489 | test |
pachyderm/pachyderm | src/server/auth/cmds/cmds.go | Cmds | func Cmds(noMetrics, noPortForwarding *bool) []*cobra.Command {
var commands []*cobra.Command
auth := &cobra.Command{
Short: "Auth commands manage access to data in a Pachyderm cluster",
Long: "Auth commands manage access to data in a Pachyderm cluster",
}
commands = append(commands, cmdutil.CreateAlias(auth... | go | func Cmds(noMetrics, noPortForwarding *bool) []*cobra.Command {
var commands []*cobra.Command
auth := &cobra.Command{
Short: "Auth commands manage access to data in a Pachyderm cluster",
Long: "Auth commands manage access to data in a Pachyderm cluster",
}
commands = append(commands, cmdutil.CreateAlias(auth... | [
"func",
"Cmds",
"(",
"noMetrics",
",",
"noPortForwarding",
"*",
"bool",
")",
"[",
"]",
"*",
"cobra",
".",
"Command",
"{",
"var",
"commands",
"[",
"]",
"*",
"cobra",
".",
"Command",
"\n",
"auth",
":=",
"&",
"cobra",
".",
"Command",
"{",
"Short",
":",
... | // Cmds returns a list of cobra commands for authenticating and authorizing
// users in an auth-enabled Pachyderm cluster. | [
"Cmds",
"returns",
"a",
"list",
"of",
"cobra",
"commands",
"for",
"authenticating",
"and",
"authorizing",
"users",
"in",
"an",
"auth",
"-",
"enabled",
"Pachyderm",
"cluster",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/cmds/cmds.go#L493-L518 | test |
pachyderm/pachyderm | src/client/auth/auth.go | ParseScope | func ParseScope(s string) (Scope, error) {
for name, value := range Scope_value {
if strings.EqualFold(s, name) {
return Scope(value), nil
}
}
return Scope_NONE, fmt.Errorf("unrecognized scope: %s", s)
} | go | func ParseScope(s string) (Scope, error) {
for name, value := range Scope_value {
if strings.EqualFold(s, name) {
return Scope(value), nil
}
}
return Scope_NONE, fmt.Errorf("unrecognized scope: %s", s)
} | [
"func",
"ParseScope",
"(",
"s",
"string",
")",
"(",
"Scope",
",",
"error",
")",
"{",
"for",
"name",
",",
"value",
":=",
"range",
"Scope_value",
"{",
"if",
"strings",
".",
"EqualFold",
"(",
"s",
",",
"name",
")",
"{",
"return",
"Scope",
"(",
"value",
... | // ParseScope parses the string 's' to a scope (for example, parsing a command-
// line argument. | [
"ParseScope",
"parses",
"the",
"string",
"s",
"to",
"a",
"scope",
"(",
"for",
"example",
"parsing",
"a",
"command",
"-",
"line",
"argument",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/auth/auth.go#L39-L46 | test |
pachyderm/pachyderm | src/client/auth/auth.go | IsErrNotActivated | func IsErrNotActivated(err error) bool {
if err == nil {
return false
}
// TODO(msteffen) This is unstructured because we have no way to propagate
// structured errors across GRPC boundaries. Fix
return strings.Contains(err.Error(), status.Convert(ErrNotActivated).Message())
} | go | func IsErrNotActivated(err error) bool {
if err == nil {
return false
}
// TODO(msteffen) This is unstructured because we have no way to propagate
// structured errors across GRPC boundaries. Fix
return strings.Contains(err.Error(), status.Convert(ErrNotActivated).Message())
} | [
"func",
"IsErrNotActivated",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"status",
".",
"Convert",
"(",
"ErrN... | // IsErrNotActivated checks if an error is a ErrNotActivated | [
"IsErrNotActivated",
"checks",
"if",
"an",
"error",
"is",
"a",
"ErrNotActivated"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/auth/auth.go#L77-L84 | test |
pachyderm/pachyderm | src/client/auth/auth.go | IsErrPartiallyActivated | func IsErrPartiallyActivated(err error) bool {
if err == nil {
return false
}
// TODO(msteffen) This is unstructured because we have no way to propagate
// structured errors across GRPC boundaries. Fix
return strings.Contains(err.Error(), status.Convert(ErrPartiallyActivated).Message())
} | go | func IsErrPartiallyActivated(err error) bool {
if err == nil {
return false
}
// TODO(msteffen) This is unstructured because we have no way to propagate
// structured errors across GRPC boundaries. Fix
return strings.Contains(err.Error(), status.Convert(ErrPartiallyActivated).Message())
} | [
"func",
"IsErrPartiallyActivated",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"status",
".",
"Convert",
"(",
... | // IsErrPartiallyActivated checks if an error is a ErrPartiallyActivated | [
"IsErrPartiallyActivated",
"checks",
"if",
"an",
"error",
"is",
"a",
"ErrPartiallyActivated"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/auth/auth.go#L87-L94 | test |
pachyderm/pachyderm | src/client/auth/auth.go | IsErrNotSignedIn | func IsErrNotSignedIn(err error) bool {
if err == nil {
return false
}
// TODO(msteffen) This is unstructured because we have no way to propagate
// structured errors across GRPC boundaries. Fix
return strings.Contains(err.Error(), status.Convert(ErrNotSignedIn).Message())
} | go | func IsErrNotSignedIn(err error) bool {
if err == nil {
return false
}
// TODO(msteffen) This is unstructured because we have no way to propagate
// structured errors across GRPC boundaries. Fix
return strings.Contains(err.Error(), status.Convert(ErrNotSignedIn).Message())
} | [
"func",
"IsErrNotSignedIn",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"status",
".",
"Convert",
"(",
"ErrNo... | // IsErrNotSignedIn returns true if 'err' is a ErrNotSignedIn | [
"IsErrNotSignedIn",
"returns",
"true",
"if",
"err",
"is",
"a",
"ErrNotSignedIn"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/auth/auth.go#L97-L104 | test |
pachyderm/pachyderm | src/client/auth/auth.go | IsErrBadToken | func IsErrBadToken(err error) bool {
if err == nil {
return false
}
return strings.Contains(err.Error(), status.Convert(ErrBadToken).Message())
} | go | func IsErrBadToken(err error) bool {
if err == nil {
return false
}
return strings.Contains(err.Error(), status.Convert(ErrBadToken).Message())
} | [
"func",
"IsErrBadToken",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"status",
".",
"Convert",
"(",
"ErrBadTo... | // IsErrBadToken returns true if 'err' is a ErrBadToken | [
"IsErrBadToken",
"returns",
"true",
"if",
"err",
"is",
"a",
"ErrBadToken"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/auth/auth.go#L116-L121 | test |
pachyderm/pachyderm | src/client/auth/auth.go | IsErrNotAuthorized | func IsErrNotAuthorized(err error) bool {
if err == nil {
return false
}
// TODO(msteffen) This is unstructured because we have no way to propagate
// structured errors across GRPC boundaries. Fix
return strings.Contains(err.Error(), errNotAuthorizedMsg)
} | go | func IsErrNotAuthorized(err error) bool {
if err == nil {
return false
}
// TODO(msteffen) This is unstructured because we have no way to propagate
// structured errors across GRPC boundaries. Fix
return strings.Contains(err.Error(), errNotAuthorizedMsg)
} | [
"func",
"IsErrNotAuthorized",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"errNotAuthorizedMsg",
")",
"\n",
"}"... | // IsErrNotAuthorized checks if an error is a ErrNotAuthorized | [
"IsErrNotAuthorized",
"checks",
"if",
"an",
"error",
"is",
"a",
"ErrNotAuthorized"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/auth/auth.go#L165-L172 | test |
pachyderm/pachyderm | src/client/auth/auth.go | IsErrInvalidPrincipal | func IsErrInvalidPrincipal(err error) bool {
if err == nil {
return false
}
return strings.Contains(err.Error(), "invalid principal \"") &&
strings.Contains(err.Error(), "\"; must start with one of \"pipeline:\", \"github:\", or \"robot:\", or have no \":\"")
} | go | func IsErrInvalidPrincipal(err error) bool {
if err == nil {
return false
}
return strings.Contains(err.Error(), "invalid principal \"") &&
strings.Contains(err.Error(), "\"; must start with one of \"pipeline:\", \"github:\", or \"robot:\", or have no \":\"")
} | [
"func",
"IsErrInvalidPrincipal",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"return",
"strings",
".",
"Contains",
"(",
"err",
".",
"Error",
"(",
")",
",",
"\"invalid principal \\\"\"",
")",
"... | // IsErrInvalidPrincipal returns true if 'err' is an ErrInvalidPrincipal | [
"IsErrInvalidPrincipal",
"returns",
"true",
"if",
"err",
"is",
"an",
"ErrInvalidPrincipal"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/auth/auth.go#L185-L191 | test |
pachyderm/pachyderm | src/client/auth/auth.go | IsErrTooShortTTL | func IsErrTooShortTTL(err error) bool {
if err == nil {
return false
}
errMsg := err.Error()
return strings.Contains(errMsg, "provided TTL (") &&
strings.Contains(errMsg, ") is shorter than token's existing TTL (") &&
strings.Contains(errMsg, ")")
} | go | func IsErrTooShortTTL(err error) bool {
if err == nil {
return false
}
errMsg := err.Error()
return strings.Contains(errMsg, "provided TTL (") &&
strings.Contains(errMsg, ") is shorter than token's existing TTL (") &&
strings.Contains(errMsg, ")")
} | [
"func",
"IsErrTooShortTTL",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"err",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"errMsg",
":=",
"err",
".",
"Error",
"(",
")",
"\n",
"return",
"strings",
".",
"Contains",
"(",
"errMsg",
",",
"\"pr... | // IsErrTooShortTTL returns true if 'err' is a ErrTooShortTTL | [
"IsErrTooShortTTL",
"returns",
"true",
"if",
"err",
"is",
"a",
"ErrTooShortTTL"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/auth/auth.go#L206-L214 | test |
pachyderm/pachyderm | src/server/worker/datum_set.go | NewDatumFactory | func NewDatumFactory(pachClient *client.APIClient, input *pps.Input) (DatumFactory, error) {
switch {
case input.Pfs != nil:
return newPFSDatumFactory(pachClient, input.Pfs)
case input.Union != nil:
return newUnionDatumFactory(pachClient, input.Union)
case input.Cross != nil:
return newCrossDatumFactory(pachC... | go | func NewDatumFactory(pachClient *client.APIClient, input *pps.Input) (DatumFactory, error) {
switch {
case input.Pfs != nil:
return newPFSDatumFactory(pachClient, input.Pfs)
case input.Union != nil:
return newUnionDatumFactory(pachClient, input.Union)
case input.Cross != nil:
return newCrossDatumFactory(pachC... | [
"func",
"NewDatumFactory",
"(",
"pachClient",
"*",
"client",
".",
"APIClient",
",",
"input",
"*",
"pps",
".",
"Input",
")",
"(",
"DatumFactory",
",",
"error",
")",
"{",
"switch",
"{",
"case",
"input",
".",
"Pfs",
"!=",
"nil",
":",
"return",
"newPFSDatumF... | // NewDatumFactory creates a datumFactory for an input. | [
"NewDatumFactory",
"creates",
"a",
"datumFactory",
"for",
"an",
"input",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/worker/datum_set.go#L195-L209 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | NewCollection | func NewCollection(etcdClient *etcd.Client, prefix string, indexes []*Index, template proto.Message, keyCheck func(string) error, valCheck func(proto.Message) error) Collection {
// We want to ensure that the prefix always ends with a trailing
// slash. Otherwise, when you list the items under a collection
// such ... | go | func NewCollection(etcdClient *etcd.Client, prefix string, indexes []*Index, template proto.Message, keyCheck func(string) error, valCheck func(proto.Message) error) Collection {
// We want to ensure that the prefix always ends with a trailing
// slash. Otherwise, when you list the items under a collection
// such ... | [
"func",
"NewCollection",
"(",
"etcdClient",
"*",
"etcd",
".",
"Client",
",",
"prefix",
"string",
",",
"indexes",
"[",
"]",
"*",
"Index",
",",
"template",
"proto",
".",
"Message",
",",
"keyCheck",
"func",
"(",
"string",
")",
"error",
",",
"valCheck",
"fun... | // NewCollection creates a new collection. | [
"NewCollection",
"creates",
"a",
"new",
"collection",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L61-L79 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | Path | func (c *collection) Path(key string) string {
return path.Join(c.prefix, key)
} | go | func (c *collection) Path(key string) string {
return path.Join(c.prefix, key)
} | [
"func",
"(",
"c",
"*",
"collection",
")",
"Path",
"(",
"key",
"string",
")",
"string",
"{",
"return",
"path",
".",
"Join",
"(",
"c",
".",
"prefix",
",",
"key",
")",
"\n",
"}"
] | // Path returns the full path of a key in the etcd namespace | [
"Path",
"returns",
"the",
"full",
"path",
"of",
"a",
"key",
"in",
"the",
"etcd",
"namespace"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L148-L150 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | getIndexPath | func (c *readWriteCollection) getIndexPath(val interface{}, index *Index, key string) string {
reflVal := reflect.ValueOf(val)
field := reflect.Indirect(reflVal).FieldByName(index.Field).Interface()
return c.indexPath(index, field, key)
} | go | func (c *readWriteCollection) getIndexPath(val interface{}, index *Index, key string) string {
reflVal := reflect.ValueOf(val)
field := reflect.Indirect(reflVal).FieldByName(index.Field).Interface()
return c.indexPath(index, field, key)
} | [
"func",
"(",
"c",
"*",
"readWriteCollection",
")",
"getIndexPath",
"(",
"val",
"interface",
"{",
"}",
",",
"index",
"*",
"Index",
",",
"key",
"string",
")",
"string",
"{",
"reflVal",
":=",
"reflect",
".",
"ValueOf",
"(",
"val",
")",
"\n",
"field",
":="... | // Giving a value, an index, and the key of the item, return the path
// under which the new index item should be stored. | [
"Giving",
"a",
"value",
"an",
"index",
"and",
"the",
"key",
"of",
"the",
"item",
"return",
"the",
"path",
"under",
"which",
"the",
"new",
"index",
"item",
"should",
"be",
"stored",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L219-L223 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | getMultiIndexPaths | func (c *readWriteCollection) getMultiIndexPaths(val interface{}, index *Index, key string) []string {
var indexPaths []string
field := reflect.Indirect(reflect.ValueOf(val)).FieldByName(index.Field)
for i := 0; i < field.Len(); i++ {
indexPaths = append(indexPaths, c.indexPath(index, field.Index(i).Interface(), k... | go | func (c *readWriteCollection) getMultiIndexPaths(val interface{}, index *Index, key string) []string {
var indexPaths []string
field := reflect.Indirect(reflect.ValueOf(val)).FieldByName(index.Field)
for i := 0; i < field.Len(); i++ {
indexPaths = append(indexPaths, c.indexPath(index, field.Index(i).Interface(), k... | [
"func",
"(",
"c",
"*",
"readWriteCollection",
")",
"getMultiIndexPaths",
"(",
"val",
"interface",
"{",
"}",
",",
"index",
"*",
"Index",
",",
"key",
"string",
")",
"[",
"]",
"string",
"{",
"var",
"indexPaths",
"[",
"]",
"string",
"\n",
"field",
":=",
"r... | // Giving a value, a multi-index, and the key of the item, return the
// paths under which the multi-index items should be stored. | [
"Giving",
"a",
"value",
"a",
"multi",
"-",
"index",
"and",
"the",
"key",
"of",
"the",
"item",
"return",
"the",
"paths",
"under",
"which",
"the",
"multi",
"-",
"index",
"items",
"should",
"be",
"stored",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L227-L234 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | Upsert | func (c *readWriteCollection) Upsert(key string, val proto.Message, f func() error) error {
if err := watch.CheckType(c.template, val); err != nil {
return err
}
if err := c.Get(key, val); err != nil && !IsErrNotFound(err) {
return err
}
if err := f(); err != nil {
return err
}
return c.Put(key, val)
} | go | func (c *readWriteCollection) Upsert(key string, val proto.Message, f func() error) error {
if err := watch.CheckType(c.template, val); err != nil {
return err
}
if err := c.Get(key, val); err != nil && !IsErrNotFound(err) {
return err
}
if err := f(); err != nil {
return err
}
return c.Put(key, val)
} | [
"func",
"(",
"c",
"*",
"readWriteCollection",
")",
"Upsert",
"(",
"key",
"string",
",",
"val",
"proto",
".",
"Message",
",",
"f",
"func",
"(",
")",
"error",
")",
"error",
"{",
"if",
"err",
":=",
"watch",
".",
"CheckType",
"(",
"c",
".",
"template",
... | // Upsert is like Update but 'key' is not required to be present | [
"Upsert",
"is",
"like",
"Update",
"but",
"key",
"is",
"not",
"required",
"to",
"be",
"present"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L341-L352 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | get | func (c *readonlyCollection) get(key string, opts ...etcd.OpOption) (*etcd.GetResponse, error) {
span, ctx := tracing.AddSpanToAnyExisting(c.ctx, "etcd.Get")
defer tracing.FinishAnySpan(span)
resp, err := c.etcdClient.Get(ctx, key, opts...)
return resp, err
} | go | func (c *readonlyCollection) get(key string, opts ...etcd.OpOption) (*etcd.GetResponse, error) {
span, ctx := tracing.AddSpanToAnyExisting(c.ctx, "etcd.Get")
defer tracing.FinishAnySpan(span)
resp, err := c.etcdClient.Get(ctx, key, opts...)
return resp, err
} | [
"func",
"(",
"c",
"*",
"readonlyCollection",
")",
"get",
"(",
"key",
"string",
",",
"opts",
"...",
"etcd",
".",
"OpOption",
")",
"(",
"*",
"etcd",
".",
"GetResponse",
",",
"error",
")",
"{",
"span",
",",
"ctx",
":=",
"tracing",
".",
"AddSpanToAnyExisti... | // get is an internal wrapper around etcdClient.Get that wraps the call in a
// trace | [
"get",
"is",
"an",
"internal",
"wrapper",
"around",
"etcdClient",
".",
"Get",
"that",
"wraps",
"the",
"call",
"in",
"a",
"trace"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L482-L487 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | List | func (c *readonlyCollection) List(val proto.Message, opts *Options, f func(string) error) error {
if err := watch.CheckType(c.template, val); err != nil {
return err
}
return c.list(c.prefix, &c.limit, opts, func(kv *mvccpb.KeyValue) error {
if err := proto.Unmarshal(kv.Value, val); err != nil {
return err
... | go | func (c *readonlyCollection) List(val proto.Message, opts *Options, f func(string) error) error {
if err := watch.CheckType(c.template, val); err != nil {
return err
}
return c.list(c.prefix, &c.limit, opts, func(kv *mvccpb.KeyValue) error {
if err := proto.Unmarshal(kv.Value, val); err != nil {
return err
... | [
"func",
"(",
"c",
"*",
"readonlyCollection",
")",
"List",
"(",
"val",
"proto",
".",
"Message",
",",
"opts",
"*",
"Options",
",",
"f",
"func",
"(",
"string",
")",
"error",
")",
"error",
"{",
"if",
"err",
":=",
"watch",
".",
"CheckType",
"(",
"c",
".... | // List returns objects sorted based on the options passed in. f will be called with each key, val will contain the
// corresponding value. Val is not an argument to f because that would require
// f to perform a cast before it could be used.
// You can break out of iteration by returning errutil.ErrBreak. | [
"List",
"returns",
"objects",
"sorted",
"based",
"on",
"the",
"options",
"passed",
"in",
".",
"f",
"will",
"be",
"called",
"with",
"each",
"key",
"val",
"will",
"contain",
"the",
"corresponding",
"value",
".",
"Val",
"is",
"not",
"an",
"argument",
"to",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L582-L592 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | Watch | func (c *readonlyCollection) Watch(opts ...watch.OpOption) (watch.Watcher, error) {
return watch.NewWatcher(c.ctx, c.etcdClient, c.prefix, c.prefix, c.template, opts...)
} | go | func (c *readonlyCollection) Watch(opts ...watch.OpOption) (watch.Watcher, error) {
return watch.NewWatcher(c.ctx, c.etcdClient, c.prefix, c.prefix, c.template, opts...)
} | [
"func",
"(",
"c",
"*",
"readonlyCollection",
")",
"Watch",
"(",
"opts",
"...",
"watch",
".",
"OpOption",
")",
"(",
"watch",
".",
"Watcher",
",",
"error",
")",
"{",
"return",
"watch",
".",
"NewWatcher",
"(",
"c",
".",
"ctx",
",",
"c",
".",
"etcdClient... | // Watch a collection, returning the current content of the collection as
// well as any future additions. | [
"Watch",
"a",
"collection",
"returning",
"the",
"current",
"content",
"of",
"the",
"collection",
"as",
"well",
"as",
"any",
"future",
"additions",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L612-L614 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | WatchByIndex | func (c *readonlyCollection) WatchByIndex(index *Index, val interface{}) (watch.Watcher, error) {
eventCh := make(chan *watch.Event)
done := make(chan struct{})
watcher, err := watch.NewWatcher(c.ctx, c.etcdClient, c.prefix, c.indexDir(index, val), c.template)
if err != nil {
return nil, err
}
go func() (retErr... | go | func (c *readonlyCollection) WatchByIndex(index *Index, val interface{}) (watch.Watcher, error) {
eventCh := make(chan *watch.Event)
done := make(chan struct{})
watcher, err := watch.NewWatcher(c.ctx, c.etcdClient, c.prefix, c.indexDir(index, val), c.template)
if err != nil {
return nil, err
}
go func() (retErr... | [
"func",
"(",
"c",
"*",
"readonlyCollection",
")",
"WatchByIndex",
"(",
"index",
"*",
"Index",
",",
"val",
"interface",
"{",
"}",
")",
"(",
"watch",
".",
"Watcher",
",",
"error",
")",
"{",
"eventCh",
":=",
"make",
"(",
"chan",
"*",
"watch",
".",
"Even... | // WatchByIndex watches items in a collection that match a particular index | [
"WatchByIndex",
"watches",
"items",
"in",
"a",
"collection",
"that",
"match",
"a",
"particular",
"index"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L617-L681 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | WatchOne | func (c *readonlyCollection) WatchOne(key string) (watch.Watcher, error) {
return watch.NewWatcher(c.ctx, c.etcdClient, c.prefix, c.Path(key), c.template)
} | go | func (c *readonlyCollection) WatchOne(key string) (watch.Watcher, error) {
return watch.NewWatcher(c.ctx, c.etcdClient, c.prefix, c.Path(key), c.template)
} | [
"func",
"(",
"c",
"*",
"readonlyCollection",
")",
"WatchOne",
"(",
"key",
"string",
")",
"(",
"watch",
".",
"Watcher",
",",
"error",
")",
"{",
"return",
"watch",
".",
"NewWatcher",
"(",
"c",
".",
"ctx",
",",
"c",
".",
"etcdClient",
",",
"c",
".",
"... | // WatchOne watches a given item. The first value returned from the watch
// will be the current value of the item. | [
"WatchOne",
"watches",
"a",
"given",
"item",
".",
"The",
"first",
"value",
"returned",
"from",
"the",
"watch",
"will",
"be",
"the",
"current",
"value",
"of",
"the",
"item",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L685-L687 | test |
pachyderm/pachyderm | src/server/pkg/collection/collection.go | WatchOneF | func (c *readonlyCollection) WatchOneF(key string, f func(e *watch.Event) error) error {
watcher, err := watch.NewWatcher(c.ctx, c.etcdClient, c.prefix, c.Path(key), c.template)
if err != nil {
return err
}
defer watcher.Close()
for {
select {
case e := <-watcher.Watch():
if err := f(e); err != nil {
... | go | func (c *readonlyCollection) WatchOneF(key string, f func(e *watch.Event) error) error {
watcher, err := watch.NewWatcher(c.ctx, c.etcdClient, c.prefix, c.Path(key), c.template)
if err != nil {
return err
}
defer watcher.Close()
for {
select {
case e := <-watcher.Watch():
if err := f(e); err != nil {
... | [
"func",
"(",
"c",
"*",
"readonlyCollection",
")",
"WatchOneF",
"(",
"key",
"string",
",",
"f",
"func",
"(",
"e",
"*",
"watch",
".",
"Event",
")",
"error",
")",
"error",
"{",
"watcher",
",",
"err",
":=",
"watch",
".",
"NewWatcher",
"(",
"c",
".",
"c... | // WatchOneF watches a given item and executes a callback function each time an event occurs.
// The first value returned from the watch will be the current value of the item. | [
"WatchOneF",
"watches",
"a",
"given",
"item",
"and",
"executes",
"a",
"callback",
"function",
"each",
"time",
"an",
"event",
"occurs",
".",
"The",
"first",
"value",
"returned",
"from",
"the",
"watch",
"will",
"be",
"the",
"current",
"value",
"of",
"the",
"... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/collection/collection.go#L691-L710 | test |
pachyderm/pachyderm | src/server/pkg/localcache/cache.go | Get | func (c *Cache) Get(key string) (io.ReadCloser, error) {
c.mu.Lock()
defer c.mu.Unlock()
if !c.keys[key] {
return nil, fmt.Errorf("key %v not found in cache", key)
}
f, err := os.Open(filepath.Join(c.root, key))
if err != nil {
return nil, err
}
return f, nil
} | go | func (c *Cache) Get(key string) (io.ReadCloser, error) {
c.mu.Lock()
defer c.mu.Unlock()
if !c.keys[key] {
return nil, fmt.Errorf("key %v not found in cache", key)
}
f, err := os.Open(filepath.Join(c.root, key))
if err != nil {
return nil, err
}
return f, nil
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Get",
"(",
"key",
"string",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"!",
"c"... | // Get gets a key's value by returning an io.ReadCloser that should be closed when done. | [
"Get",
"gets",
"a",
"key",
"s",
"value",
"by",
"returning",
"an",
"io",
".",
"ReadCloser",
"that",
"should",
"be",
"closed",
"when",
"done",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/localcache/cache.go#L52-L63 | test |
pachyderm/pachyderm | src/server/pkg/localcache/cache.go | Keys | func (c *Cache) Keys() []string {
c.mu.Lock()
defer c.mu.Unlock()
var keys []string
for key := range c.keys {
keys = append(keys, key)
}
sort.Strings(keys)
return keys
} | go | func (c *Cache) Keys() []string {
c.mu.Lock()
defer c.mu.Unlock()
var keys []string
for key := range c.keys {
keys = append(keys, key)
}
sort.Strings(keys)
return keys
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Keys",
"(",
")",
"[",
"]",
"string",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"var",
"keys",
"[",
"]",
"string",
"\n",
"for",
"key",
":="... | // Keys returns the keys in sorted order. | [
"Keys",
"returns",
"the",
"keys",
"in",
"sorted",
"order",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/localcache/cache.go#L66-L75 | test |
pachyderm/pachyderm | src/server/pkg/localcache/cache.go | Clear | func (c *Cache) Clear() error {
c.mu.Lock()
defer c.mu.Unlock()
defer func() {
c.keys = make(map[string]bool)
}()
for key := range c.keys {
if err := os.Remove(filepath.Join(c.root, key)); err != nil {
return err
}
}
return nil
} | go | func (c *Cache) Clear() error {
c.mu.Lock()
defer c.mu.Unlock()
defer func() {
c.keys = make(map[string]bool)
}()
for key := range c.keys {
if err := os.Remove(filepath.Join(c.root, key)); err != nil {
return err
}
}
return nil
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Clear",
"(",
")",
"error",
"{",
"c",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"defer",
"func",
"(",
")",
"{",
"c",
".",
"keys",
"=",
"make",
"(",
... | // Clear clears the cache. | [
"Clear",
"clears",
"the",
"cache",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/localcache/cache.go#L89-L101 | test |
pachyderm/pachyderm | src/server/http/http.go | NewHTTPServer | func NewHTTPServer(address string) (http.Handler, error) {
router := httprouter.New()
s := &server{
router: router,
address: address,
httpClient: &http.Client{},
}
router.GET(getFilePath, s.getFileHandler)
router.GET(servicePath, s.serviceHandler)
router.POST(loginPath, s.authLoginHandler)
router.... | go | func NewHTTPServer(address string) (http.Handler, error) {
router := httprouter.New()
s := &server{
router: router,
address: address,
httpClient: &http.Client{},
}
router.GET(getFilePath, s.getFileHandler)
router.GET(servicePath, s.serviceHandler)
router.POST(loginPath, s.authLoginHandler)
router.... | [
"func",
"NewHTTPServer",
"(",
"address",
"string",
")",
"(",
"http",
".",
"Handler",
",",
"error",
")",
"{",
"router",
":=",
"httprouter",
".",
"New",
"(",
")",
"\n",
"s",
":=",
"&",
"server",
"{",
"router",
":",
"router",
",",
"address",
":",
"addre... | // NewHTTPServer returns a Pachyderm HTTP server. | [
"NewHTTPServer",
"returns",
"a",
"Pachyderm",
"HTTP",
"server",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/http/http.go#L47-L64 | test |
pachyderm/pachyderm | src/server/deploy/deploy.go | NewDeployServer | func NewDeployServer(kubeClient *kube.Clientset, kubeNamespace string) deploy.APIServer {
return &apiServer{
kubeClient: kubeClient,
kubeNamespace: kubeNamespace,
}
} | go | func NewDeployServer(kubeClient *kube.Clientset, kubeNamespace string) deploy.APIServer {
return &apiServer{
kubeClient: kubeClient,
kubeNamespace: kubeNamespace,
}
} | [
"func",
"NewDeployServer",
"(",
"kubeClient",
"*",
"kube",
".",
"Clientset",
",",
"kubeNamespace",
"string",
")",
"deploy",
".",
"APIServer",
"{",
"return",
"&",
"apiServer",
"{",
"kubeClient",
":",
"kubeClient",
",",
"kubeNamespace",
":",
"kubeNamespace",
",",
... | // NewDeployServer creates a deploy server | [
"NewDeployServer",
"creates",
"a",
"deploy",
"server"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/deploy/deploy.go#L20-L25 | test |
pachyderm/pachyderm | src/server/pkg/deploy/images/images.go | Export | func Export(opts *assets.AssetOpts, out io.Writer) error {
client, err := docker.NewClientFromEnv()
if err != nil {
return err
}
authConfigs, err := docker.NewAuthConfigurationsFromDockerCfg()
if err != nil {
return fmt.Errorf("error parsing auth: %s, try running `docker login`", err.Error())
}
if len(authCo... | go | func Export(opts *assets.AssetOpts, out io.Writer) error {
client, err := docker.NewClientFromEnv()
if err != nil {
return err
}
authConfigs, err := docker.NewAuthConfigurationsFromDockerCfg()
if err != nil {
return fmt.Errorf("error parsing auth: %s, try running `docker login`", err.Error())
}
if len(authCo... | [
"func",
"Export",
"(",
"opts",
"*",
"assets",
".",
"AssetOpts",
",",
"out",
"io",
".",
"Writer",
")",
"error",
"{",
"client",
",",
"err",
":=",
"docker",
".",
"NewClientFromEnv",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
... | // Export a tarball of the images needed by a deployment. | [
"Export",
"a",
"tarball",
"of",
"the",
"images",
"needed",
"by",
"a",
"deployment",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/deploy/images/images.go#L13-L57 | test |
pachyderm/pachyderm | src/server/pkg/deploy/images/images.go | Import | func Import(opts *assets.AssetOpts, in io.Reader) error {
client, err := docker.NewClientFromEnv()
if err != nil {
return err
}
authConfigs, err := docker.NewAuthConfigurationsFromDockerCfg()
if err != nil {
return fmt.Errorf("error parsing auth: %s, try running `docker login`", err.Error())
}
if len(authCon... | go | func Import(opts *assets.AssetOpts, in io.Reader) error {
client, err := docker.NewClientFromEnv()
if err != nil {
return err
}
authConfigs, err := docker.NewAuthConfigurationsFromDockerCfg()
if err != nil {
return fmt.Errorf("error parsing auth: %s, try running `docker login`", err.Error())
}
if len(authCon... | [
"func",
"Import",
"(",
"opts",
"*",
"assets",
".",
"AssetOpts",
",",
"in",
"io",
".",
"Reader",
")",
"error",
"{",
"client",
",",
"err",
":=",
"docker",
".",
"NewClientFromEnv",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
... | // Import a tarball of the images needed by a deployment such as the one
// created by Export and push those images to the registry specific in opts. | [
"Import",
"a",
"tarball",
"of",
"the",
"images",
"needed",
"by",
"a",
"deployment",
"such",
"as",
"the",
"one",
"created",
"by",
"Export",
"and",
"push",
"those",
"images",
"to",
"the",
"registry",
"specific",
"in",
"opts",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/deploy/images/images.go#L61-L119 | test |
pachyderm/pachyderm | src/client/pps.go | DatumTagPrefix | func DatumTagPrefix(salt string) string {
// We need to hash the salt because UUIDs are not necessarily
// random in every bit.
h := sha256.New()
h.Write([]byte(salt))
return hex.EncodeToString(h.Sum(nil))[:4]
} | go | func DatumTagPrefix(salt string) string {
// We need to hash the salt because UUIDs are not necessarily
// random in every bit.
h := sha256.New()
h.Write([]byte(salt))
return hex.EncodeToString(h.Sum(nil))[:4]
} | [
"func",
"DatumTagPrefix",
"(",
"salt",
"string",
")",
"string",
"{",
"h",
":=",
"sha256",
".",
"New",
"(",
")",
"\n",
"h",
".",
"Write",
"(",
"[",
"]",
"byte",
"(",
"salt",
")",
")",
"\n",
"return",
"hex",
".",
"EncodeToString",
"(",
"h",
".",
"S... | // DatumTagPrefix hashes a pipeline salt to a string of a fixed size for use as
// the prefix for datum output trees. This prefix allows us to do garbage
// collection correctly. | [
"DatumTagPrefix",
"hashes",
"a",
"pipeline",
"salt",
"to",
"a",
"string",
"of",
"a",
"fixed",
"size",
"for",
"use",
"as",
"the",
"prefix",
"for",
"datum",
"output",
"trees",
".",
"This",
"prefix",
"allows",
"us",
"to",
"do",
"garbage",
"collection",
"corre... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L81-L87 | test |
pachyderm/pachyderm | src/client/pps.go | NewPFSInput | func NewPFSInput(repo string, glob string) *pps.Input {
return &pps.Input{
Pfs: &pps.PFSInput{
Repo: repo,
Glob: glob,
},
}
} | go | func NewPFSInput(repo string, glob string) *pps.Input {
return &pps.Input{
Pfs: &pps.PFSInput{
Repo: repo,
Glob: glob,
},
}
} | [
"func",
"NewPFSInput",
"(",
"repo",
"string",
",",
"glob",
"string",
")",
"*",
"pps",
".",
"Input",
"{",
"return",
"&",
"pps",
".",
"Input",
"{",
"Pfs",
":",
"&",
"pps",
".",
"PFSInput",
"{",
"Repo",
":",
"repo",
",",
"Glob",
":",
"glob",
",",
"}... | // NewPFSInput returns a new PFS input. It only includes required options. | [
"NewPFSInput",
"returns",
"a",
"new",
"PFS",
"input",
".",
"It",
"only",
"includes",
"required",
"options",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L90-L97 | test |
pachyderm/pachyderm | src/client/pps.go | NewPFSInputOpts | func NewPFSInputOpts(name string, repo string, branch string, glob string, lazy bool) *pps.Input {
return &pps.Input{
Pfs: &pps.PFSInput{
Name: name,
Repo: repo,
Branch: branch,
Glob: glob,
Lazy: lazy,
},
}
} | go | func NewPFSInputOpts(name string, repo string, branch string, glob string, lazy bool) *pps.Input {
return &pps.Input{
Pfs: &pps.PFSInput{
Name: name,
Repo: repo,
Branch: branch,
Glob: glob,
Lazy: lazy,
},
}
} | [
"func",
"NewPFSInputOpts",
"(",
"name",
"string",
",",
"repo",
"string",
",",
"branch",
"string",
",",
"glob",
"string",
",",
"lazy",
"bool",
")",
"*",
"pps",
".",
"Input",
"{",
"return",
"&",
"pps",
".",
"Input",
"{",
"Pfs",
":",
"&",
"pps",
".",
... | // NewPFSInputOpts returns a new PFS input. It includes all options. | [
"NewPFSInputOpts",
"returns",
"a",
"new",
"PFS",
"input",
".",
"It",
"includes",
"all",
"options",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L100-L110 | test |
pachyderm/pachyderm | src/client/pps.go | NewJobInput | func NewJobInput(repoName string, commitID string, glob string) *pps.JobInput {
return &pps.JobInput{
Commit: NewCommit(repoName, commitID),
Glob: glob,
}
} | go | func NewJobInput(repoName string, commitID string, glob string) *pps.JobInput {
return &pps.JobInput{
Commit: NewCommit(repoName, commitID),
Glob: glob,
}
} | [
"func",
"NewJobInput",
"(",
"repoName",
"string",
",",
"commitID",
"string",
",",
"glob",
"string",
")",
"*",
"pps",
".",
"JobInput",
"{",
"return",
"&",
"pps",
".",
"JobInput",
"{",
"Commit",
":",
"NewCommit",
"(",
"repoName",
",",
"commitID",
")",
",",... | // NewJobInput creates a pps.JobInput. | [
"NewJobInput",
"creates",
"a",
"pps",
".",
"JobInput",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L144-L149 | test |
pachyderm/pachyderm | src/client/pps.go | NewPipelineInput | func NewPipelineInput(repoName string, glob string) *pps.PipelineInput {
return &pps.PipelineInput{
Repo: NewRepo(repoName),
Glob: glob,
}
} | go | func NewPipelineInput(repoName string, glob string) *pps.PipelineInput {
return &pps.PipelineInput{
Repo: NewRepo(repoName),
Glob: glob,
}
} | [
"func",
"NewPipelineInput",
"(",
"repoName",
"string",
",",
"glob",
"string",
")",
"*",
"pps",
".",
"PipelineInput",
"{",
"return",
"&",
"pps",
".",
"PipelineInput",
"{",
"Repo",
":",
"NewRepo",
"(",
"repoName",
")",
",",
"Glob",
":",
"glob",
",",
"}",
... | // NewPipelineInput creates a new pps.PipelineInput | [
"NewPipelineInput",
"creates",
"a",
"new",
"pps",
".",
"PipelineInput"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L157-L162 | test |
pachyderm/pachyderm | src/client/pps.go | CreateJob | func (c APIClient) CreateJob(pipeline string, outputCommit *pfs.Commit) (*pps.Job, error) {
job, err := c.PpsAPIClient.CreateJob(
c.Ctx(),
&pps.CreateJobRequest{
Pipeline: NewPipeline(pipeline),
OutputCommit: outputCommit,
},
)
return job, grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) CreateJob(pipeline string, outputCommit *pfs.Commit) (*pps.Job, error) {
job, err := c.PpsAPIClient.CreateJob(
c.Ctx(),
&pps.CreateJobRequest{
Pipeline: NewPipeline(pipeline),
OutputCommit: outputCommit,
},
)
return job, grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"CreateJob",
"(",
"pipeline",
"string",
",",
"outputCommit",
"*",
"pfs",
".",
"Commit",
")",
"(",
"*",
"pps",
".",
"Job",
",",
"error",
")",
"{",
"job",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"CreateJob",... | // CreateJob creates and runs a job in PPS.
// This function is mostly useful internally, users should generally run work
// by creating pipelines as well. | [
"CreateJob",
"creates",
"and",
"runs",
"a",
"job",
"in",
"PPS",
".",
"This",
"function",
"is",
"mostly",
"useful",
"internally",
"users",
"should",
"generally",
"run",
"work",
"by",
"creating",
"pipelines",
"as",
"well",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L167-L176 | test |
pachyderm/pachyderm | src/client/pps.go | ListJob | func (c APIClient) ListJob(pipelineName string, inputCommit []*pfs.Commit, outputCommit *pfs.Commit) ([]*pps.JobInfo, error) {
var result []*pps.JobInfo
if err := c.ListJobF(pipelineName, inputCommit, outputCommit, func(ji *pps.JobInfo) error {
result = append(result, ji)
return nil
}); err != nil {
return nil... | go | func (c APIClient) ListJob(pipelineName string, inputCommit []*pfs.Commit, outputCommit *pfs.Commit) ([]*pps.JobInfo, error) {
var result []*pps.JobInfo
if err := c.ListJobF(pipelineName, inputCommit, outputCommit, func(ji *pps.JobInfo) error {
result = append(result, ji)
return nil
}); err != nil {
return nil... | [
"func",
"(",
"c",
"APIClient",
")",
"ListJob",
"(",
"pipelineName",
"string",
",",
"inputCommit",
"[",
"]",
"*",
"pfs",
".",
"Commit",
",",
"outputCommit",
"*",
"pfs",
".",
"Commit",
")",
"(",
"[",
"]",
"*",
"pps",
".",
"JobInfo",
",",
"error",
")",
... | // ListJob returns info about all jobs.
// If pipelineName is non empty then only jobs that were started by the named pipeline will be returned
// If inputCommit is non-nil then only jobs which took the specific commits as inputs will be returned.
// The order of the inputCommits doesn't matter.
// If outputCommit is n... | [
"ListJob",
"returns",
"info",
"about",
"all",
"jobs",
".",
"If",
"pipelineName",
"is",
"non",
"empty",
"then",
"only",
"jobs",
"that",
"were",
"started",
"by",
"the",
"named",
"pipeline",
"will",
"be",
"returned",
"If",
"inputCommit",
"is",
"non",
"-",
"ni... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L207-L216 | test |
pachyderm/pachyderm | src/client/pps.go | ListJobF | func (c APIClient) ListJobF(pipelineName string, inputCommit []*pfs.Commit, outputCommit *pfs.Commit, f func(*pps.JobInfo) error) error {
var pipeline *pps.Pipeline
if pipelineName != "" {
pipeline = NewPipeline(pipelineName)
}
client, err := c.PpsAPIClient.ListJobStream(
c.Ctx(),
&pps.ListJobRequest{
Pipe... | go | func (c APIClient) ListJobF(pipelineName string, inputCommit []*pfs.Commit, outputCommit *pfs.Commit, f func(*pps.JobInfo) error) error {
var pipeline *pps.Pipeline
if pipelineName != "" {
pipeline = NewPipeline(pipelineName)
}
client, err := c.PpsAPIClient.ListJobStream(
c.Ctx(),
&pps.ListJobRequest{
Pipe... | [
"func",
"(",
"c",
"APIClient",
")",
"ListJobF",
"(",
"pipelineName",
"string",
",",
"inputCommit",
"[",
"]",
"*",
"pfs",
".",
"Commit",
",",
"outputCommit",
"*",
"pfs",
".",
"Commit",
",",
"f",
"func",
"(",
"*",
"pps",
".",
"JobInfo",
")",
"error",
"... | // ListJobF returns info about all jobs, calling f with each JobInfo.
// If f returns an error iteration of jobs will stop and ListJobF will return
// that error, unless the error is errutil.ErrBreak in which case it will
// return nil.
// If pipelineName is non empty then only jobs that were started by the named pipel... | [
"ListJobF",
"returns",
"info",
"about",
"all",
"jobs",
"calling",
"f",
"with",
"each",
"JobInfo",
".",
"If",
"f",
"returns",
"an",
"error",
"iteration",
"of",
"jobs",
"will",
"stop",
"and",
"ListJobF",
"will",
"return",
"that",
"error",
"unless",
"the",
"e... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L226-L255 | test |
pachyderm/pachyderm | src/client/pps.go | FlushJob | func (c APIClient) FlushJob(commits []*pfs.Commit, toPipelines []string, f func(*pps.JobInfo) error) error {
req := &pps.FlushJobRequest{
Commits: commits,
}
for _, pipeline := range toPipelines {
req.ToPipelines = append(req.ToPipelines, NewPipeline(pipeline))
}
client, err := c.PpsAPIClient.FlushJob(c.Ctx(),... | go | func (c APIClient) FlushJob(commits []*pfs.Commit, toPipelines []string, f func(*pps.JobInfo) error) error {
req := &pps.FlushJobRequest{
Commits: commits,
}
for _, pipeline := range toPipelines {
req.ToPipelines = append(req.ToPipelines, NewPipeline(pipeline))
}
client, err := c.PpsAPIClient.FlushJob(c.Ctx(),... | [
"func",
"(",
"c",
"APIClient",
")",
"FlushJob",
"(",
"commits",
"[",
"]",
"*",
"pfs",
".",
"Commit",
",",
"toPipelines",
"[",
"]",
"string",
",",
"f",
"func",
"(",
"*",
"pps",
".",
"JobInfo",
")",
"error",
")",
"error",
"{",
"req",
":=",
"&",
"pp... | // FlushJob calls f with all the jobs which were triggered by commits.
// If toPipelines is non-nil then only the jobs between commits and those
// pipelines in the DAG will be returned. | [
"FlushJob",
"calls",
"f",
"with",
"all",
"the",
"jobs",
"which",
"were",
"triggered",
"by",
"commits",
".",
"If",
"toPipelines",
"is",
"non",
"-",
"nil",
"then",
"only",
"the",
"jobs",
"between",
"commits",
"and",
"those",
"pipelines",
"in",
"the",
"DAG",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L260-L283 | test |
pachyderm/pachyderm | src/client/pps.go | FlushJobAll | func (c APIClient) FlushJobAll(commits []*pfs.Commit, toPipelines []string) ([]*pps.JobInfo, error) {
var result []*pps.JobInfo
if err := c.FlushJob(commits, toPipelines, func(ji *pps.JobInfo) error {
result = append(result, ji)
return nil
}); err != nil {
return nil, err
}
return result, nil
} | go | func (c APIClient) FlushJobAll(commits []*pfs.Commit, toPipelines []string) ([]*pps.JobInfo, error) {
var result []*pps.JobInfo
if err := c.FlushJob(commits, toPipelines, func(ji *pps.JobInfo) error {
result = append(result, ji)
return nil
}); err != nil {
return nil, err
}
return result, nil
} | [
"func",
"(",
"c",
"APIClient",
")",
"FlushJobAll",
"(",
"commits",
"[",
"]",
"*",
"pfs",
".",
"Commit",
",",
"toPipelines",
"[",
"]",
"string",
")",
"(",
"[",
"]",
"*",
"pps",
".",
"JobInfo",
",",
"error",
")",
"{",
"var",
"result",
"[",
"]",
"*"... | // FlushJobAll returns all the jobs which were triggered by commits.
// If toPipelines is non-nil then only the jobs between commits and those
// pipelines in the DAG will be returned. | [
"FlushJobAll",
"returns",
"all",
"the",
"jobs",
"which",
"were",
"triggered",
"by",
"commits",
".",
"If",
"toPipelines",
"is",
"non",
"-",
"nil",
"then",
"only",
"the",
"jobs",
"between",
"commits",
"and",
"those",
"pipelines",
"in",
"the",
"DAG",
"will",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L288-L297 | test |
pachyderm/pachyderm | src/client/pps.go | DeleteJob | func (c APIClient) DeleteJob(jobID string) error {
_, err := c.PpsAPIClient.DeleteJob(
c.Ctx(),
&pps.DeleteJobRequest{
Job: NewJob(jobID),
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) DeleteJob(jobID string) error {
_, err := c.PpsAPIClient.DeleteJob(
c.Ctx(),
&pps.DeleteJobRequest{
Job: NewJob(jobID),
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"DeleteJob",
"(",
"jobID",
"string",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"DeleteJob",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pps",
".",
"DeleteJobRequest",
"{",
"Job",
":"... | // DeleteJob deletes a job. | [
"DeleteJob",
"deletes",
"a",
"job",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L300-L308 | test |
pachyderm/pachyderm | src/client/pps.go | StopJob | func (c APIClient) StopJob(jobID string) error {
_, err := c.PpsAPIClient.StopJob(
c.Ctx(),
&pps.StopJobRequest{
Job: NewJob(jobID),
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) StopJob(jobID string) error {
_, err := c.PpsAPIClient.StopJob(
c.Ctx(),
&pps.StopJobRequest{
Job: NewJob(jobID),
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"StopJob",
"(",
"jobID",
"string",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"StopJob",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pps",
".",
"StopJobRequest",
"{",
"Job",
":",
"N... | // StopJob stops a job. | [
"StopJob",
"stops",
"a",
"job",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L311-L319 | test |
pachyderm/pachyderm | src/client/pps.go | RestartDatum | func (c APIClient) RestartDatum(jobID string, datumFilter []string) error {
_, err := c.PpsAPIClient.RestartDatum(
c.Ctx(),
&pps.RestartDatumRequest{
Job: NewJob(jobID),
DataFilters: datumFilter,
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) RestartDatum(jobID string, datumFilter []string) error {
_, err := c.PpsAPIClient.RestartDatum(
c.Ctx(),
&pps.RestartDatumRequest{
Job: NewJob(jobID),
DataFilters: datumFilter,
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"RestartDatum",
"(",
"jobID",
"string",
",",
"datumFilter",
"[",
"]",
"string",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"RestartDatum",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"... | // RestartDatum restarts a datum that's being processed as part of a job.
// datumFilter is a slice of strings which are matched against either the Path
// or Hash of the datum, the order of the strings in datumFilter is irrelevant. | [
"RestartDatum",
"restarts",
"a",
"datum",
"that",
"s",
"being",
"processed",
"as",
"part",
"of",
"a",
"job",
".",
"datumFilter",
"is",
"a",
"slice",
"of",
"strings",
"which",
"are",
"matched",
"against",
"either",
"the",
"Path",
"or",
"Hash",
"of",
"the",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L324-L333 | test |
pachyderm/pachyderm | src/client/pps.go | ListDatum | func (c APIClient) ListDatum(jobID string, pageSize int64, page int64) (*pps.ListDatumResponse, error) {
client, err := c.PpsAPIClient.ListDatumStream(
c.Ctx(),
&pps.ListDatumRequest{
Job: NewJob(jobID),
PageSize: pageSize,
Page: page,
},
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err... | go | func (c APIClient) ListDatum(jobID string, pageSize int64, page int64) (*pps.ListDatumResponse, error) {
client, err := c.PpsAPIClient.ListDatumStream(
c.Ctx(),
&pps.ListDatumRequest{
Job: NewJob(jobID),
PageSize: pageSize,
Page: page,
},
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err... | [
"func",
"(",
"c",
"APIClient",
")",
"ListDatum",
"(",
"jobID",
"string",
",",
"pageSize",
"int64",
",",
"page",
"int64",
")",
"(",
"*",
"pps",
".",
"ListDatumResponse",
",",
"error",
")",
"{",
"client",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
... | // ListDatum returns info about all datums in a Job | [
"ListDatum",
"returns",
"info",
"about",
"all",
"datums",
"in",
"a",
"Job"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L336-L365 | test |
pachyderm/pachyderm | src/client/pps.go | ListDatumF | func (c APIClient) ListDatumF(jobID string, pageSize int64, page int64, f func(di *pps.DatumInfo) error) error {
client, err := c.PpsAPIClient.ListDatumStream(
c.Ctx(),
&pps.ListDatumRequest{
Job: NewJob(jobID),
PageSize: pageSize,
Page: page,
},
)
if err != nil {
return grpcutil.ScrubGRPC(... | go | func (c APIClient) ListDatumF(jobID string, pageSize int64, page int64, f func(di *pps.DatumInfo) error) error {
client, err := c.PpsAPIClient.ListDatumStream(
c.Ctx(),
&pps.ListDatumRequest{
Job: NewJob(jobID),
PageSize: pageSize,
Page: page,
},
)
if err != nil {
return grpcutil.ScrubGRPC(... | [
"func",
"(",
"c",
"APIClient",
")",
"ListDatumF",
"(",
"jobID",
"string",
",",
"pageSize",
"int64",
",",
"page",
"int64",
",",
"f",
"func",
"(",
"di",
"*",
"pps",
".",
"DatumInfo",
")",
"error",
")",
"error",
"{",
"client",
",",
"err",
":=",
"c",
"... | // ListDatumF returns info about all datums in a Job, calling f with each datum info. | [
"ListDatumF",
"returns",
"info",
"about",
"all",
"datums",
"in",
"a",
"Job",
"calling",
"f",
"with",
"each",
"datum",
"info",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L368-L394 | test |
pachyderm/pachyderm | src/client/pps.go | InspectDatum | func (c APIClient) InspectDatum(jobID string, datumID string) (*pps.DatumInfo, error) {
datumInfo, err := c.PpsAPIClient.InspectDatum(
c.Ctx(),
&pps.InspectDatumRequest{
Datum: &pps.Datum{
ID: datumID,
Job: NewJob(jobID),
},
},
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err)
}
return d... | go | func (c APIClient) InspectDatum(jobID string, datumID string) (*pps.DatumInfo, error) {
datumInfo, err := c.PpsAPIClient.InspectDatum(
c.Ctx(),
&pps.InspectDatumRequest{
Datum: &pps.Datum{
ID: datumID,
Job: NewJob(jobID),
},
},
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err)
}
return d... | [
"func",
"(",
"c",
"APIClient",
")",
"InspectDatum",
"(",
"jobID",
"string",
",",
"datumID",
"string",
")",
"(",
"*",
"pps",
".",
"DatumInfo",
",",
"error",
")",
"{",
"datumInfo",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"InspectDatum",
"(",
"c"... | // InspectDatum returns info about a single datum | [
"InspectDatum",
"returns",
"info",
"about",
"a",
"single",
"datum"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L397-L411 | test |
pachyderm/pachyderm | src/client/pps.go | Next | func (l *LogsIter) Next() bool {
if l.err != nil {
l.msg = nil
return false
}
l.msg, l.err = l.logsClient.Recv()
if l.err != nil {
return false
}
return true
} | go | func (l *LogsIter) Next() bool {
if l.err != nil {
l.msg = nil
return false
}
l.msg, l.err = l.logsClient.Recv()
if l.err != nil {
return false
}
return true
} | [
"func",
"(",
"l",
"*",
"LogsIter",
")",
"Next",
"(",
")",
"bool",
"{",
"if",
"l",
".",
"err",
"!=",
"nil",
"{",
"l",
".",
"msg",
"=",
"nil",
"\n",
"return",
"false",
"\n",
"}",
"\n",
"l",
".",
"msg",
",",
"l",
".",
"err",
"=",
"l",
".",
"... | // Next retrieves the next relevant log message from pachd | [
"Next",
"retrieves",
"the",
"next",
"relevant",
"log",
"message",
"from",
"pachd"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L423-L433 | test |
pachyderm/pachyderm | src/client/pps.go | InspectPipeline | func (c APIClient) InspectPipeline(pipelineName string) (*pps.PipelineInfo, error) {
pipelineInfo, err := c.PpsAPIClient.InspectPipeline(
c.Ctx(),
&pps.InspectPipelineRequest{
Pipeline: NewPipeline(pipelineName),
},
)
return pipelineInfo, grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) InspectPipeline(pipelineName string) (*pps.PipelineInfo, error) {
pipelineInfo, err := c.PpsAPIClient.InspectPipeline(
c.Ctx(),
&pps.InspectPipelineRequest{
Pipeline: NewPipeline(pipelineName),
},
)
return pipelineInfo, grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"InspectPipeline",
"(",
"pipelineName",
"string",
")",
"(",
"*",
"pps",
".",
"PipelineInfo",
",",
"error",
")",
"{",
"pipelineInfo",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"InspectPipeline",
"(",
"c",
".",
"C... | // InspectPipeline returns info about a specific pipeline. | [
"InspectPipeline",
"returns",
"info",
"about",
"a",
"specific",
"pipeline",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L534-L542 | test |
pachyderm/pachyderm | src/client/pps.go | ListPipeline | func (c APIClient) ListPipeline() ([]*pps.PipelineInfo, error) {
pipelineInfos, err := c.PpsAPIClient.ListPipeline(
c.Ctx(),
&pps.ListPipelineRequest{},
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err)
}
return pipelineInfos.PipelineInfo, nil
} | go | func (c APIClient) ListPipeline() ([]*pps.PipelineInfo, error) {
pipelineInfos, err := c.PpsAPIClient.ListPipeline(
c.Ctx(),
&pps.ListPipelineRequest{},
)
if err != nil {
return nil, grpcutil.ScrubGRPC(err)
}
return pipelineInfos.PipelineInfo, nil
} | [
"func",
"(",
"c",
"APIClient",
")",
"ListPipeline",
"(",
")",
"(",
"[",
"]",
"*",
"pps",
".",
"PipelineInfo",
",",
"error",
")",
"{",
"pipelineInfos",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"ListPipeline",
"(",
"c",
".",
"Ctx",
"(",
")",
... | // ListPipeline returns info about all pipelines. | [
"ListPipeline",
"returns",
"info",
"about",
"all",
"pipelines",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L545-L554 | test |
pachyderm/pachyderm | src/client/pps.go | DeletePipeline | func (c APIClient) DeletePipeline(name string, force bool) error {
_, err := c.PpsAPIClient.DeletePipeline(
c.Ctx(),
&pps.DeletePipelineRequest{
Pipeline: NewPipeline(name),
Force: force,
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) DeletePipeline(name string, force bool) error {
_, err := c.PpsAPIClient.DeletePipeline(
c.Ctx(),
&pps.DeletePipelineRequest{
Pipeline: NewPipeline(name),
Force: force,
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"DeletePipeline",
"(",
"name",
"string",
",",
"force",
"bool",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"DeletePipeline",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pps",
".",
"Del... | // DeletePipeline deletes a pipeline along with its output Repo. | [
"DeletePipeline",
"deletes",
"a",
"pipeline",
"along",
"with",
"its",
"output",
"Repo",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L557-L566 | test |
pachyderm/pachyderm | src/client/pps.go | StartPipeline | func (c APIClient) StartPipeline(name string) error {
_, err := c.PpsAPIClient.StartPipeline(
c.Ctx(),
&pps.StartPipelineRequest{
Pipeline: NewPipeline(name),
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) StartPipeline(name string) error {
_, err := c.PpsAPIClient.StartPipeline(
c.Ctx(),
&pps.StartPipelineRequest{
Pipeline: NewPipeline(name),
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"StartPipeline",
"(",
"name",
"string",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"StartPipeline",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pps",
".",
"StartPipelineRequest",
"{",
"... | // StartPipeline restarts a stopped pipeline. | [
"StartPipeline",
"restarts",
"a",
"stopped",
"pipeline",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L569-L577 | test |
pachyderm/pachyderm | src/client/pps.go | StopPipeline | func (c APIClient) StopPipeline(name string) error {
_, err := c.PpsAPIClient.StopPipeline(
c.Ctx(),
&pps.StopPipelineRequest{
Pipeline: NewPipeline(name),
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) StopPipeline(name string) error {
_, err := c.PpsAPIClient.StopPipeline(
c.Ctx(),
&pps.StopPipelineRequest{
Pipeline: NewPipeline(name),
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"StopPipeline",
"(",
"name",
"string",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PpsAPIClient",
".",
"StopPipeline",
"(",
"c",
".",
"Ctx",
"(",
")",
",",
"&",
"pps",
".",
"StopPipelineRequest",
"{",
"Pip... | // StopPipeline prevents a pipeline from processing things, it can be restarted
// with StartPipeline. | [
"StopPipeline",
"prevents",
"a",
"pipeline",
"from",
"processing",
"things",
"it",
"can",
"be",
"restarted",
"with",
"StartPipeline",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L581-L589 | test |
pachyderm/pachyderm | src/client/pps.go | RerunPipeline | func (c APIClient) RerunPipeline(name string, include []*pfs.Commit, exclude []*pfs.Commit) error {
_, err := c.PpsAPIClient.RerunPipeline(
c.Ctx(),
&pps.RerunPipelineRequest{
Pipeline: NewPipeline(name),
Include: include,
Exclude: exclude,
},
)
return grpcutil.ScrubGRPC(err)
} | go | func (c APIClient) RerunPipeline(name string, include []*pfs.Commit, exclude []*pfs.Commit) error {
_, err := c.PpsAPIClient.RerunPipeline(
c.Ctx(),
&pps.RerunPipelineRequest{
Pipeline: NewPipeline(name),
Include: include,
Exclude: exclude,
},
)
return grpcutil.ScrubGRPC(err)
} | [
"func",
"(",
"c",
"APIClient",
")",
"RerunPipeline",
"(",
"name",
"string",
",",
"include",
"[",
"]",
"*",
"pfs",
".",
"Commit",
",",
"exclude",
"[",
"]",
"*",
"pfs",
".",
"Commit",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"PpsAPIClient"... | // RerunPipeline reruns a pipeline over a given set of commits. Exclude and
// include are filters that either include or exclude the ancestors of the
// given commits. A commit is considered the ancestor of itself. The behavior
// is the same as that of ListCommit. | [
"RerunPipeline",
"reruns",
"a",
"pipeline",
"over",
"a",
"given",
"set",
"of",
"commits",
".",
"Exclude",
"and",
"include",
"are",
"filters",
"that",
"either",
"include",
"or",
"exclude",
"the",
"ancestors",
"of",
"the",
"given",
"commits",
".",
"A",
"commit... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L595-L605 | test |
pachyderm/pachyderm | src/client/pps.go | CreatePipelineService | func (c APIClient) CreatePipelineService(
name string,
image string,
cmd []string,
stdin []string,
parallelismSpec *pps.ParallelismSpec,
input *pps.Input,
update bool,
internalPort int32,
externalPort int32,
) error {
_, err := c.PpsAPIClient.CreatePipeline(
c.Ctx(),
&pps.CreatePipelineRequest{
Pipelin... | go | func (c APIClient) CreatePipelineService(
name string,
image string,
cmd []string,
stdin []string,
parallelismSpec *pps.ParallelismSpec,
input *pps.Input,
update bool,
internalPort int32,
externalPort int32,
) error {
_, err := c.PpsAPIClient.CreatePipeline(
c.Ctx(),
&pps.CreatePipelineRequest{
Pipelin... | [
"func",
"(",
"c",
"APIClient",
")",
"CreatePipelineService",
"(",
"name",
"string",
",",
"image",
"string",
",",
"cmd",
"[",
"]",
"string",
",",
"stdin",
"[",
"]",
"string",
",",
"parallelismSpec",
"*",
"pps",
".",
"ParallelismSpec",
",",
"input",
"*",
"... | // CreatePipelineService creates a new pipeline service. | [
"CreatePipelineService",
"creates",
"a",
"new",
"pipeline",
"service",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L608-L638 | test |
pachyderm/pachyderm | src/client/pps.go | GetDatumTotalTime | func GetDatumTotalTime(s *pps.ProcessStats) time.Duration {
totalDuration := time.Duration(0)
duration, _ := types.DurationFromProto(s.DownloadTime)
totalDuration += duration
duration, _ = types.DurationFromProto(s.ProcessTime)
totalDuration += duration
duration, _ = types.DurationFromProto(s.UploadTime)
totalDu... | go | func GetDatumTotalTime(s *pps.ProcessStats) time.Duration {
totalDuration := time.Duration(0)
duration, _ := types.DurationFromProto(s.DownloadTime)
totalDuration += duration
duration, _ = types.DurationFromProto(s.ProcessTime)
totalDuration += duration
duration, _ = types.DurationFromProto(s.UploadTime)
totalDu... | [
"func",
"GetDatumTotalTime",
"(",
"s",
"*",
"pps",
".",
"ProcessStats",
")",
"time",
".",
"Duration",
"{",
"totalDuration",
":=",
"time",
".",
"Duration",
"(",
"0",
")",
"\n",
"duration",
",",
"_",
":=",
"types",
".",
"DurationFromProto",
"(",
"s",
".",
... | // GetDatumTotalTime sums the timing stats from a DatumInfo | [
"GetDatumTotalTime",
"sums",
"the",
"timing",
"stats",
"from",
"a",
"DatumInfo"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pps.go#L658-L667 | test |
pachyderm/pachyderm | src/server/pfs/fuse/filesystem.go | Mount | func Mount(c *client.APIClient, mountPoint string, opts *Options) error {
nfs := pathfs.NewPathNodeFs(newFileSystem(c, opts.getCommits()), nil)
server, _, err := nodefs.MountRoot(mountPoint, nfs.Root(), opts.getFuse())
if err != nil {
return fmt.Errorf("nodefs.MountRoot: %v", err)
}
sigChan := make(chan os.Signa... | go | func Mount(c *client.APIClient, mountPoint string, opts *Options) error {
nfs := pathfs.NewPathNodeFs(newFileSystem(c, opts.getCommits()), nil)
server, _, err := nodefs.MountRoot(mountPoint, nfs.Root(), opts.getFuse())
if err != nil {
return fmt.Errorf("nodefs.MountRoot: %v", err)
}
sigChan := make(chan os.Signa... | [
"func",
"Mount",
"(",
"c",
"*",
"client",
".",
"APIClient",
",",
"mountPoint",
"string",
",",
"opts",
"*",
"Options",
")",
"error",
"{",
"nfs",
":=",
"pathfs",
".",
"NewPathNodeFs",
"(",
"newFileSystem",
"(",
"c",
",",
"opts",
".",
"getCommits",
"(",
"... | // Mount pfs to mountPoint, opts may be left nil. | [
"Mount",
"pfs",
"to",
"mountPoint",
"opts",
"may",
"be",
"left",
"nil",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pfs/fuse/filesystem.go#L25-L42 | test |
pachyderm/pachyderm | src/client/pkg/grpcutil/buffer.go | NewBufPool | func NewBufPool(size int) *BufPool {
return &BufPool{sync.Pool{
New: func() interface{} { return make([]byte, size) },
}}
} | go | func NewBufPool(size int) *BufPool {
return &BufPool{sync.Pool{
New: func() interface{} { return make([]byte, size) },
}}
} | [
"func",
"NewBufPool",
"(",
"size",
"int",
")",
"*",
"BufPool",
"{",
"return",
"&",
"BufPool",
"{",
"sync",
".",
"Pool",
"{",
"New",
":",
"func",
"(",
")",
"interface",
"{",
"}",
"{",
"return",
"make",
"(",
"[",
"]",
"byte",
",",
"size",
")",
"}",... | // NewBufPool creates a new BufPool that returns buffers of the given size. | [
"NewBufPool",
"creates",
"a",
"new",
"BufPool",
"that",
"returns",
"buffers",
"of",
"the",
"given",
"size",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/client/pkg/grpcutil/buffer.go#L14-L18 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | StorageRootFromEnv | func StorageRootFromEnv() (string, error) {
storageRoot, ok := os.LookupEnv(PachRootEnvVar)
if !ok {
return "", fmt.Errorf("%s not found", PachRootEnvVar)
}
storageBackend, ok := os.LookupEnv(StorageBackendEnvVar)
if !ok {
return "", fmt.Errorf("%s not found", StorageBackendEnvVar)
}
// These storage backend... | go | func StorageRootFromEnv() (string, error) {
storageRoot, ok := os.LookupEnv(PachRootEnvVar)
if !ok {
return "", fmt.Errorf("%s not found", PachRootEnvVar)
}
storageBackend, ok := os.LookupEnv(StorageBackendEnvVar)
if !ok {
return "", fmt.Errorf("%s not found", StorageBackendEnvVar)
}
// These storage backend... | [
"func",
"StorageRootFromEnv",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"storageRoot",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"PachRootEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"\"\"",
",",
"fmt",
".",
"Errorf",
"(",
"\"%s not f... | // StorageRootFromEnv gets the storage root based on environment variables. | [
"StorageRootFromEnv",
"gets",
"the",
"storage",
"root",
"based",
"on",
"environment",
"variables",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L106-L125 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | BlockPathFromEnv | func BlockPathFromEnv(block *pfs.Block) (string, error) {
storageRoot, err := StorageRootFromEnv()
if err != nil {
return "", err
}
return filepath.Join(storageRoot, "block", block.Hash), nil
} | go | func BlockPathFromEnv(block *pfs.Block) (string, error) {
storageRoot, err := StorageRootFromEnv()
if err != nil {
return "", err
}
return filepath.Join(storageRoot, "block", block.Hash), nil
} | [
"func",
"BlockPathFromEnv",
"(",
"block",
"*",
"pfs",
".",
"Block",
")",
"(",
"string",
",",
"error",
")",
"{",
"storageRoot",
",",
"err",
":=",
"StorageRootFromEnv",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"\"",
",",
"err",
"\n",
... | // BlockPathFromEnv gets the path to an object storage block based on environment variables. | [
"BlockPathFromEnv",
"gets",
"the",
"path",
"to",
"an",
"object",
"storage",
"block",
"based",
"on",
"environment",
"variables",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L128-L134 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewGoogleClient | func NewGoogleClient(bucket string, opts []option.ClientOption) (Client, error) {
return newGoogleClient(bucket, opts)
} | go | func NewGoogleClient(bucket string, opts []option.ClientOption) (Client, error) {
return newGoogleClient(bucket, opts)
} | [
"func",
"NewGoogleClient",
"(",
"bucket",
"string",
",",
"opts",
"[",
"]",
"option",
".",
"ClientOption",
")",
"(",
"Client",
",",
"error",
")",
"{",
"return",
"newGoogleClient",
"(",
"bucket",
",",
"opts",
")",
"\n",
"}"
] | // NewGoogleClient creates a google client with the given bucket name. | [
"NewGoogleClient",
"creates",
"a",
"google",
"client",
"with",
"the",
"given",
"bucket",
"name",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L164-L166 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewGoogleClientFromSecret | func NewGoogleClientFromSecret(bucket string) (Client, error) {
var err error
if bucket == "" {
bucket, err = readSecretFile("/google-bucket")
if err != nil {
return nil, fmt.Errorf("google-bucket not found")
}
}
cred, err := readSecretFile("/google-cred")
if err != nil {
return nil, fmt.Errorf("google-... | go | func NewGoogleClientFromSecret(bucket string) (Client, error) {
var err error
if bucket == "" {
bucket, err = readSecretFile("/google-bucket")
if err != nil {
return nil, fmt.Errorf("google-bucket not found")
}
}
cred, err := readSecretFile("/google-cred")
if err != nil {
return nil, fmt.Errorf("google-... | [
"func",
"NewGoogleClientFromSecret",
"(",
"bucket",
"string",
")",
"(",
"Client",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"if",
"bucket",
"==",
"\"\"",
"{",
"bucket",
",",
"err",
"=",
"readSecretFile",
"(",
"\"/google-bucket\"",
")",
"\n",
"if... | // NewGoogleClientFromSecret creates a google client by reading credentials
// from a mounted GoogleSecret. You may pass "" for bucket in which case it
// will read the bucket from the secret. | [
"NewGoogleClientFromSecret",
"creates",
"a",
"google",
"client",
"by",
"reading",
"credentials",
"from",
"a",
"mounted",
"GoogleSecret",
".",
"You",
"may",
"pass",
"for",
"bucket",
"in",
"which",
"case",
"it",
"will",
"read",
"the",
"bucket",
"from",
"the",
"s... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L183-L202 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewGoogleClientFromEnv | func NewGoogleClientFromEnv() (Client, error) {
bucket, ok := os.LookupEnv(GoogleBucketEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", GoogleBucketEnvVar)
}
creds, ok := os.LookupEnv(GoogleCredEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", GoogleCredEnvVar)
}
opts := []option.ClientOption{op... | go | func NewGoogleClientFromEnv() (Client, error) {
bucket, ok := os.LookupEnv(GoogleBucketEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", GoogleBucketEnvVar)
}
creds, ok := os.LookupEnv(GoogleCredEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", GoogleCredEnvVar)
}
opts := []option.ClientOption{op... | [
"func",
"NewGoogleClientFromEnv",
"(",
")",
"(",
"Client",
",",
"error",
")",
"{",
"bucket",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"GoogleBucketEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"%s not... | // NewGoogleClientFromEnv creates a Google client based on environment variables. | [
"NewGoogleClientFromEnv",
"creates",
"a",
"Google",
"client",
"based",
"on",
"environment",
"variables",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L205-L216 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewMicrosoftClientFromSecret | func NewMicrosoftClientFromSecret(container string) (Client, error) {
var err error
if container == "" {
container, err = readSecretFile("/microsoft-container")
if err != nil {
return nil, fmt.Errorf("microsoft-container not found")
}
}
id, err := readSecretFile("/microsoft-id")
if err != nil {
return n... | go | func NewMicrosoftClientFromSecret(container string) (Client, error) {
var err error
if container == "" {
container, err = readSecretFile("/microsoft-container")
if err != nil {
return nil, fmt.Errorf("microsoft-container not found")
}
}
id, err := readSecretFile("/microsoft-id")
if err != nil {
return n... | [
"func",
"NewMicrosoftClientFromSecret",
"(",
"container",
"string",
")",
"(",
"Client",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"if",
"container",
"==",
"\"\"",
"{",
"container",
",",
"err",
"=",
"readSecretFile",
"(",
"\"/microsoft-container\"",
... | // NewMicrosoftClientFromSecret creates a microsoft client by reading
// credentials from a mounted MicrosoftSecret. You may pass "" for container in
// which case it will read the container from the secret. | [
"NewMicrosoftClientFromSecret",
"creates",
"a",
"microsoft",
"client",
"by",
"reading",
"credentials",
"from",
"a",
"mounted",
"MicrosoftSecret",
".",
"You",
"may",
"pass",
"for",
"container",
"in",
"which",
"case",
"it",
"will",
"read",
"the",
"container",
"from"... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L229-L246 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewMicrosoftClientFromEnv | func NewMicrosoftClientFromEnv() (Client, error) {
container, ok := os.LookupEnv(MicrosoftContainerEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", MicrosoftContainerEnvVar)
}
id, ok := os.LookupEnv(MicrosoftIDEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", MicrosoftIDEnvVar)
}
secret, ok := o... | go | func NewMicrosoftClientFromEnv() (Client, error) {
container, ok := os.LookupEnv(MicrosoftContainerEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", MicrosoftContainerEnvVar)
}
id, ok := os.LookupEnv(MicrosoftIDEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", MicrosoftIDEnvVar)
}
secret, ok := o... | [
"func",
"NewMicrosoftClientFromEnv",
"(",
")",
"(",
"Client",
",",
"error",
")",
"{",
"container",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"MicrosoftContainerEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",... | // NewMicrosoftClientFromEnv creates a Microsoft client based on environment variables. | [
"NewMicrosoftClientFromEnv",
"creates",
"a",
"Microsoft",
"client",
"based",
"on",
"environment",
"variables",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L249-L263 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewMinioClientFromSecret | func NewMinioClientFromSecret(bucket string) (Client, error) {
var err error
if bucket == "" {
bucket, err = readSecretFile("/minio-bucket")
if err != nil {
return nil, err
}
}
endpoint, err := readSecretFile("/minio-endpoint")
if err != nil {
return nil, err
}
id, err := readSecretFile("/minio-id")
... | go | func NewMinioClientFromSecret(bucket string) (Client, error) {
var err error
if bucket == "" {
bucket, err = readSecretFile("/minio-bucket")
if err != nil {
return nil, err
}
}
endpoint, err := readSecretFile("/minio-endpoint")
if err != nil {
return nil, err
}
id, err := readSecretFile("/minio-id")
... | [
"func",
"NewMinioClientFromSecret",
"(",
"bucket",
"string",
")",
"(",
"Client",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"if",
"bucket",
"==",
"\"\"",
"{",
"bucket",
",",
"err",
"=",
"readSecretFile",
"(",
"\"/minio-bucket\"",
")",
"\n",
"if",... | // NewMinioClientFromSecret constructs an s3 compatible client by reading
// credentials from a mounted AmazonSecret. You may pass "" for bucket in which case it
// will read the bucket from the secret. | [
"NewMinioClientFromSecret",
"constructs",
"an",
"s3",
"compatible",
"client",
"by",
"reading",
"credentials",
"from",
"a",
"mounted",
"AmazonSecret",
".",
"You",
"may",
"pass",
"for",
"bucket",
"in",
"which",
"case",
"it",
"will",
"read",
"the",
"bucket",
"from"... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L293-L322 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewMinioClientFromEnv | func NewMinioClientFromEnv() (Client, error) {
bucket, ok := os.LookupEnv(MinioBucketEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", MinioBucketEnvVar)
}
endpoint, ok := os.LookupEnv(MinioEndpointEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", MinioEndpointEnvVar)
}
id, ok := os.LookupEnv(Min... | go | func NewMinioClientFromEnv() (Client, error) {
bucket, ok := os.LookupEnv(MinioBucketEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", MinioBucketEnvVar)
}
endpoint, ok := os.LookupEnv(MinioEndpointEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", MinioEndpointEnvVar)
}
id, ok := os.LookupEnv(Min... | [
"func",
"NewMinioClientFromEnv",
"(",
")",
"(",
"Client",
",",
"error",
")",
"{",
"bucket",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"MinioBucketEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"%s not f... | // NewMinioClientFromEnv creates a Minio client based on environment variables. | [
"NewMinioClientFromEnv",
"creates",
"a",
"Minio",
"client",
"based",
"on",
"environment",
"variables",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L325-L351 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewAmazonClientFromSecret | func NewAmazonClientFromSecret(bucket string, reversed ...bool) (Client, error) {
// Get AWS region (required for constructing an AWS client)
region, err := readSecretFile("/amazon-region")
if err != nil {
return nil, fmt.Errorf("amazon-region not found")
}
// Use or retrieve S3 bucket
if bucket == "" {
buck... | go | func NewAmazonClientFromSecret(bucket string, reversed ...bool) (Client, error) {
// Get AWS region (required for constructing an AWS client)
region, err := readSecretFile("/amazon-region")
if err != nil {
return nil, fmt.Errorf("amazon-region not found")
}
// Use or retrieve S3 bucket
if bucket == "" {
buck... | [
"func",
"NewAmazonClientFromSecret",
"(",
"bucket",
"string",
",",
"reversed",
"...",
"bool",
")",
"(",
"Client",
",",
"error",
")",
"{",
"region",
",",
"err",
":=",
"readSecretFile",
"(",
"\"/amazon-region\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"re... | // NewAmazonClientFromSecret constructs an amazon client by reading credentials
// from a mounted AmazonSecret. You may pass "" for bucket in which case it
// will read the bucket from the secret. | [
"NewAmazonClientFromSecret",
"constructs",
"an",
"amazon",
"client",
"by",
"reading",
"credentials",
"from",
"a",
"mounted",
"AmazonSecret",
".",
"You",
"may",
"pass",
"for",
"bucket",
"in",
"which",
"case",
"it",
"will",
"read",
"the",
"bucket",
"from",
"the",
... | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L356-L402 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewAmazonClientFromEnv | func NewAmazonClientFromEnv() (Client, error) {
region, ok := os.LookupEnv(AmazonRegionEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", AmazonRegionEnvVar)
}
bucket, ok := os.LookupEnv(AmazonBucketEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", AmazonBucketEnvVar)
}
var creds AmazonCreds
cre... | go | func NewAmazonClientFromEnv() (Client, error) {
region, ok := os.LookupEnv(AmazonRegionEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", AmazonRegionEnvVar)
}
bucket, ok := os.LookupEnv(AmazonBucketEnvVar)
if !ok {
return nil, fmt.Errorf("%s not found", AmazonBucketEnvVar)
}
var creds AmazonCreds
cre... | [
"func",
"NewAmazonClientFromEnv",
"(",
")",
"(",
"Client",
",",
"error",
")",
"{",
"region",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"AmazonRegionEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"%s not... | // NewAmazonClientFromEnv creates a Amazon client based on environment variables. | [
"NewAmazonClientFromEnv",
"creates",
"a",
"Amazon",
"client",
"based",
"on",
"environment",
"variables",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L405-L425 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewClientFromURLAndSecret | func NewClientFromURLAndSecret(url *ObjectStoreURL, reversed ...bool) (c Client, err error) {
switch url.Store {
case "s3":
c, err = NewAmazonClientFromSecret(url.Bucket, reversed...)
case "gcs":
fallthrough
case "gs":
c, err = NewGoogleClientFromSecret(url.Bucket)
case "as":
fallthrough
case "wasb":
//... | go | func NewClientFromURLAndSecret(url *ObjectStoreURL, reversed ...bool) (c Client, err error) {
switch url.Store {
case "s3":
c, err = NewAmazonClientFromSecret(url.Bucket, reversed...)
case "gcs":
fallthrough
case "gs":
c, err = NewGoogleClientFromSecret(url.Bucket)
case "as":
fallthrough
case "wasb":
//... | [
"func",
"NewClientFromURLAndSecret",
"(",
"url",
"*",
"ObjectStoreURL",
",",
"reversed",
"...",
"bool",
")",
"(",
"c",
"Client",
",",
"err",
"error",
")",
"{",
"switch",
"url",
".",
"Store",
"{",
"case",
"\"s3\"",
":",
"c",
",",
"err",
"=",
"NewAmazonCli... | // NewClientFromURLAndSecret constructs a client by parsing `URL` and then
// constructing the correct client for that URL using secrets. | [
"NewClientFromURLAndSecret",
"constructs",
"a",
"client",
"by",
"parsing",
"URL",
"and",
"then",
"constructing",
"the",
"correct",
"client",
"for",
"that",
"URL",
"using",
"secrets",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L429-L453 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | ParseURL | func ParseURL(urlStr string) (*ObjectStoreURL, error) {
url, err := url.Parse(urlStr)
if err != nil {
return nil, fmt.Errorf("error parsing url %v: %v", urlStr, err)
}
switch url.Scheme {
case "s3", "gcs", "gs", "local":
return &ObjectStoreURL{
Store: url.Scheme,
Bucket: url.Host,
Object: strings.Tri... | go | func ParseURL(urlStr string) (*ObjectStoreURL, error) {
url, err := url.Parse(urlStr)
if err != nil {
return nil, fmt.Errorf("error parsing url %v: %v", urlStr, err)
}
switch url.Scheme {
case "s3", "gcs", "gs", "local":
return &ObjectStoreURL{
Store: url.Scheme,
Bucket: url.Host,
Object: strings.Tri... | [
"func",
"ParseURL",
"(",
"urlStr",
"string",
")",
"(",
"*",
"ObjectStoreURL",
",",
"error",
")",
"{",
"url",
",",
"err",
":=",
"url",
".",
"Parse",
"(",
"urlStr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",... | // ParseURL parses an URL into ObjectStoreURL. | [
"ParseURL",
"parses",
"an",
"URL",
"into",
"ObjectStoreURL",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L466-L491 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewClientFromEnv | func NewClientFromEnv(storageRoot string) (c Client, err error) {
storageBackend, ok := os.LookupEnv(StorageBackendEnvVar)
if !ok {
return nil, fmt.Errorf("storage backend environment variable not found")
}
switch storageBackend {
case Amazon:
c, err = NewAmazonClientFromEnv()
case Google:
c, err = NewGoogl... | go | func NewClientFromEnv(storageRoot string) (c Client, err error) {
storageBackend, ok := os.LookupEnv(StorageBackendEnvVar)
if !ok {
return nil, fmt.Errorf("storage backend environment variable not found")
}
switch storageBackend {
case Amazon:
c, err = NewAmazonClientFromEnv()
case Google:
c, err = NewGoogl... | [
"func",
"NewClientFromEnv",
"(",
"storageRoot",
"string",
")",
"(",
"c",
"Client",
",",
"err",
"error",
")",
"{",
"storageBackend",
",",
"ok",
":=",
"os",
".",
"LookupEnv",
"(",
"StorageBackendEnvVar",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",... | // NewClientFromEnv creates a client based on environment variables. | [
"NewClientFromEnv",
"creates",
"a",
"client",
"based",
"on",
"environment",
"variables",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L494-L519 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | NewExponentialBackOffConfig | func NewExponentialBackOffConfig() *backoff.ExponentialBackOff {
config := backoff.NewExponentialBackOff()
// We want to backoff more aggressively (i.e. wait longer) than the default
config.InitialInterval = 1 * time.Second
config.Multiplier = 2
config.MaxInterval = 15 * time.Minute
return config
} | go | func NewExponentialBackOffConfig() *backoff.ExponentialBackOff {
config := backoff.NewExponentialBackOff()
// We want to backoff more aggressively (i.e. wait longer) than the default
config.InitialInterval = 1 * time.Second
config.Multiplier = 2
config.MaxInterval = 15 * time.Minute
return config
} | [
"func",
"NewExponentialBackOffConfig",
"(",
")",
"*",
"backoff",
".",
"ExponentialBackOff",
"{",
"config",
":=",
"backoff",
".",
"NewExponentialBackOff",
"(",
")",
"\n",
"config",
".",
"InitialInterval",
"=",
"1",
"*",
"time",
".",
"Second",
"\n",
"config",
".... | // NewExponentialBackOffConfig creates an exponential back-off config with
// longer wait times than the default. | [
"NewExponentialBackOffConfig",
"creates",
"an",
"exponential",
"back",
"-",
"off",
"config",
"with",
"longer",
"wait",
"times",
"than",
"the",
"default",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L523-L530 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | Close | func (b *BackoffReadCloser) Close() error {
span, _ := tracing.AddSpanToAnyExisting(b.ctx, "obj/BackoffReadCloser.Close")
defer tracing.FinishAnySpan(span)
return b.reader.Close()
} | go | func (b *BackoffReadCloser) Close() error {
span, _ := tracing.AddSpanToAnyExisting(b.ctx, "obj/BackoffReadCloser.Close")
defer tracing.FinishAnySpan(span)
return b.reader.Close()
} | [
"func",
"(",
"b",
"*",
"BackoffReadCloser",
")",
"Close",
"(",
")",
"error",
"{",
"span",
",",
"_",
":=",
"tracing",
".",
"AddSpanToAnyExisting",
"(",
"b",
".",
"ctx",
",",
"\"obj/BackoffReadCloser.Close\"",
")",
"\n",
"defer",
"tracing",
".",
"FinishAnySpan... | // Close closes the ReaderCloser contained in b. | [
"Close",
"closes",
"the",
"ReaderCloser",
"contained",
"in",
"b",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L581-L585 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | Close | func (b *BackoffWriteCloser) Close() error {
span, _ := tracing.AddSpanToAnyExisting(b.ctx, "obj/BackoffWriteCloser.Close")
defer tracing.FinishAnySpan(span)
err := b.writer.Close()
if b.client.IsIgnorable(err) {
return nil
}
return err
} | go | func (b *BackoffWriteCloser) Close() error {
span, _ := tracing.AddSpanToAnyExisting(b.ctx, "obj/BackoffWriteCloser.Close")
defer tracing.FinishAnySpan(span)
err := b.writer.Close()
if b.client.IsIgnorable(err) {
return nil
}
return err
} | [
"func",
"(",
"b",
"*",
"BackoffWriteCloser",
")",
"Close",
"(",
")",
"error",
"{",
"span",
",",
"_",
":=",
"tracing",
".",
"AddSpanToAnyExisting",
"(",
"b",
".",
"ctx",
",",
"\"obj/BackoffWriteCloser.Close\"",
")",
"\n",
"defer",
"tracing",
".",
"FinishAnySp... | // Close closes the WriteCloser contained in b. | [
"Close",
"closes",
"the",
"WriteCloser",
"contained",
"in",
"b",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L629-L637 | test |
pachyderm/pachyderm | src/server/pkg/obj/obj.go | IsRetryable | func IsRetryable(client Client, err error) bool {
return isNetRetryable(err) || client.IsRetryable(err)
} | go | func IsRetryable(client Client, err error) bool {
return isNetRetryable(err) || client.IsRetryable(err)
} | [
"func",
"IsRetryable",
"(",
"client",
"Client",
",",
"err",
"error",
")",
"bool",
"{",
"return",
"isNetRetryable",
"(",
"err",
")",
"||",
"client",
".",
"IsRetryable",
"(",
"err",
")",
"\n",
"}"
] | // IsRetryable determines if an operation should be retried given an error | [
"IsRetryable",
"determines",
"if",
"an",
"operation",
"should",
"be",
"retried",
"given",
"an",
"error"
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/obj/obj.go#L640-L642 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/exec.go | RunStdin | func RunStdin(stdin io.Reader, args ...string) error {
return RunIO(IO{Stdin: stdin}, args...)
} | go | func RunStdin(stdin io.Reader, args ...string) error {
return RunIO(IO{Stdin: stdin}, args...)
} | [
"func",
"RunStdin",
"(",
"stdin",
"io",
".",
"Reader",
",",
"args",
"...",
"string",
")",
"error",
"{",
"return",
"RunIO",
"(",
"IO",
"{",
"Stdin",
":",
"stdin",
"}",
",",
"args",
"...",
")",
"\n",
"}"
] | // RunStdin runs the command with the given stdin and arguments. | [
"RunStdin",
"runs",
"the",
"command",
"with",
"the",
"given",
"stdin",
"and",
"arguments",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/exec.go#L25-L27 | test |
pachyderm/pachyderm | src/server/pkg/cmdutil/exec.go | RunIODirPath | func RunIODirPath(ioObj IO, dirPath string, args ...string) error {
var debugStderr io.ReadWriter = bytes.NewBuffer(nil)
var stderr io.Writer = debugStderr
if ioObj.Stderr != nil {
stderr = io.MultiWriter(debugStderr, ioObj.Stderr)
}
cmd := exec.Command(args[0], args[1:]...)
cmd.Stdin = ioObj.Stdin
cmd.Stdout ... | go | func RunIODirPath(ioObj IO, dirPath string, args ...string) error {
var debugStderr io.ReadWriter = bytes.NewBuffer(nil)
var stderr io.Writer = debugStderr
if ioObj.Stderr != nil {
stderr = io.MultiWriter(debugStderr, ioObj.Stderr)
}
cmd := exec.Command(args[0], args[1:]...)
cmd.Stdin = ioObj.Stdin
cmd.Stdout ... | [
"func",
"RunIODirPath",
"(",
"ioObj",
"IO",
",",
"dirPath",
"string",
",",
"args",
"...",
"string",
")",
"error",
"{",
"var",
"debugStderr",
"io",
".",
"ReadWriter",
"=",
"bytes",
".",
"NewBuffer",
"(",
"nil",
")",
"\n",
"var",
"stderr",
"io",
".",
"Wr... | // RunIODirPath runs the command with the given IO and arguments in the given directory specified by dirPath. | [
"RunIODirPath",
"runs",
"the",
"command",
"with",
"the",
"given",
"IO",
"and",
"arguments",
"in",
"the",
"given",
"directory",
"specified",
"by",
"dirPath",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/pkg/cmdutil/exec.go#L30-L49 | test |
pachyderm/pachyderm | src/server/auth/server/api_server.go | NewAuthServer | func NewAuthServer(env *serviceenv.ServiceEnv, etcdPrefix string, public bool) (authclient.APIServer, error) {
s := &apiServer{
env: env,
pachLogger: log.NewLogger("authclient.API"),
adminCache: make(map[string]struct{}),
tokens: col.NewCollection(
env.GetEtcdClient(),
path.Join(etcdPrefix, tokens... | go | func NewAuthServer(env *serviceenv.ServiceEnv, etcdPrefix string, public bool) (authclient.APIServer, error) {
s := &apiServer{
env: env,
pachLogger: log.NewLogger("authclient.API"),
adminCache: make(map[string]struct{}),
tokens: col.NewCollection(
env.GetEtcdClient(),
path.Join(etcdPrefix, tokens... | [
"func",
"NewAuthServer",
"(",
"env",
"*",
"serviceenv",
".",
"ServiceEnv",
",",
"etcdPrefix",
"string",
",",
"public",
"bool",
")",
"(",
"authclient",
".",
"APIServer",
",",
"error",
")",
"{",
"s",
":=",
"&",
"apiServer",
"{",
"env",
":",
"env",
",",
"... | // NewAuthServer returns an implementation of authclient.APIServer. | [
"NewAuthServer",
"returns",
"an",
"implementation",
"of",
"authclient",
".",
"APIServer",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/server/api_server.go#L159-L233 | test |
pachyderm/pachyderm | src/server/auth/server/api_server.go | expiredClusterAdminCheck | func (a *apiServer) expiredClusterAdminCheck(ctx context.Context, username string) error {
state, err := a.getEnterpriseTokenState()
if err != nil {
return fmt.Errorf("error confirming Pachyderm Enterprise token: %v", err)
}
isAdmin, err := a.isAdmin(ctx, username)
if err != nil {
return err
}
if state != e... | go | func (a *apiServer) expiredClusterAdminCheck(ctx context.Context, username string) error {
state, err := a.getEnterpriseTokenState()
if err != nil {
return fmt.Errorf("error confirming Pachyderm Enterprise token: %v", err)
}
isAdmin, err := a.isAdmin(ctx, username)
if err != nil {
return err
}
if state != e... | [
"func",
"(",
"a",
"*",
"apiServer",
")",
"expiredClusterAdminCheck",
"(",
"ctx",
"context",
".",
"Context",
",",
"username",
"string",
")",
"error",
"{",
"state",
",",
"err",
":=",
"a",
".",
"getEnterpriseTokenState",
"(",
")",
"\n",
"if",
"err",
"!=",
"... | // expiredClusterAdminCheck enforces that if the cluster's enterprise token is
// expired, only admins may log in. | [
"expiredClusterAdminCheck",
"enforces",
"that",
"if",
"the",
"cluster",
"s",
"enterprise",
"token",
"is",
"expired",
"only",
"admins",
"may",
"log",
"in",
"."
] | 94fb2d536cb6852a77a49e8f777dc9c1bde2c723 | https://github.com/pachyderm/pachyderm/blob/94fb2d536cb6852a77a49e8f777dc9c1bde2c723/src/server/auth/server/api_server.go#L793-L809 | test |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.