id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
21,700 | Microsoft/hcsshim | ext4/internal/compactext4/compact.go | Stat | func (w *Writer) Stat(name string) (*File, error) {
if err := w.finishInode(); err != nil {
return nil, err
}
_, node, _, err := w.lookup(name, true)
if err != nil {
return nil, err
}
f := &File{
Size: node.Size,
Mode: node.Mode,
Uid: node.Uid,
Gid: node.Gid,
Atime: fsTimeToTime... | go | func (w *Writer) Stat(name string) (*File, error) {
if err := w.finishInode(); err != nil {
return nil, err
}
_, node, _, err := w.lookup(name, true)
if err != nil {
return nil, err
}
f := &File{
Size: node.Size,
Mode: node.Mode,
Uid: node.Uid,
Gid: node.Gid,
Atime: fsTimeToTime... | [
"func",
"(",
"w",
"*",
"Writer",
")",
"Stat",
"(",
"name",
"string",
")",
"(",
"*",
"File",
",",
"error",
")",
"{",
"if",
"err",
":=",
"w",
".",
"finishInode",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\... | // Stat returns information about a file that has been written. | [
"Stat",
"returns",
"information",
"about",
"a",
"file",
"that",
"has",
"been",
"written",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/ext4/internal/compactext4/compact.go#L598-L646 |
21,701 | Microsoft/hcsshim | ext4/internal/compactext4/compact.go | NewWriter | func NewWriter(f io.ReadWriteSeeker, opts ...Option) *Writer {
w := &Writer{
f: f,
bw: bufio.NewWriterSize(f, 65536*8),
maxDiskSize: defaultMaxDiskSize,
}
for _, opt := range opts {
opt(w)
}
return w
} | go | func NewWriter(f io.ReadWriteSeeker, opts ...Option) *Writer {
w := &Writer{
f: f,
bw: bufio.NewWriterSize(f, 65536*8),
maxDiskSize: defaultMaxDiskSize,
}
for _, opt := range opts {
opt(w)
}
return w
} | [
"func",
"NewWriter",
"(",
"f",
"io",
".",
"ReadWriteSeeker",
",",
"opts",
"...",
"Option",
")",
"*",
"Writer",
"{",
"w",
":=",
"&",
"Writer",
"{",
"f",
":",
"f",
",",
"bw",
":",
"bufio",
".",
"NewWriterSize",
"(",
"f",
",",
"65536",
"*",
"8",
")"... | // NewWriter returns a Writer that writes an ext4 file system to the provided
// WriteSeeker. | [
"NewWriter",
"returns",
"a",
"Writer",
"that",
"writes",
"an",
"ext4",
"file",
"system",
"to",
"the",
"provided",
"WriteSeeker",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/ext4/internal/compactext4/compact.go#L1021-L1031 |
21,702 | Microsoft/hcsshim | ext4/internal/compactext4/compact.go | MaximumDiskSize | func MaximumDiskSize(size int64) Option {
return func(w *Writer) {
if size < 0 || size > maxMaxDiskSize {
w.maxDiskSize = maxMaxDiskSize
} else if size == 0 {
w.maxDiskSize = defaultMaxDiskSize
} else {
w.maxDiskSize = (size + blockSize - 1) &^ (blockSize - 1)
}
}
} | go | func MaximumDiskSize(size int64) Option {
return func(w *Writer) {
if size < 0 || size > maxMaxDiskSize {
w.maxDiskSize = maxMaxDiskSize
} else if size == 0 {
w.maxDiskSize = defaultMaxDiskSize
} else {
w.maxDiskSize = (size + blockSize - 1) &^ (blockSize - 1)
}
}
} | [
"func",
"MaximumDiskSize",
"(",
"size",
"int64",
")",
"Option",
"{",
"return",
"func",
"(",
"w",
"*",
"Writer",
")",
"{",
"if",
"size",
"<",
"0",
"||",
"size",
">",
"maxMaxDiskSize",
"{",
"w",
".",
"maxDiskSize",
"=",
"maxMaxDiskSize",
"\n",
"}",
"else... | // MaximumDiskSize instructs the writer to reserve enough metadata space for the
// specified disk size. If not provided, then 16GB is the default. | [
"MaximumDiskSize",
"instructs",
"the",
"writer",
"to",
"reserve",
"enough",
"metadata",
"space",
"for",
"the",
"specified",
"disk",
"size",
".",
"If",
"not",
"provided",
"then",
"16GB",
"is",
"the",
"default",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/ext4/internal/compactext4/compact.go#L1045-L1055 |
21,703 | Microsoft/hcsshim | cmd/containerd-shim-runhcs-v1/service_internal.go | getPod | func (s *service) getPod() (shimPod, error) {
raw := s.taskOrPod.Load()
if raw == nil {
return nil, errors.Wrapf(errdefs.ErrFailedPrecondition, "task with id: '%s' must be created first", s.tid)
}
return raw.(shimPod), nil
} | go | func (s *service) getPod() (shimPod, error) {
raw := s.taskOrPod.Load()
if raw == nil {
return nil, errors.Wrapf(errdefs.ErrFailedPrecondition, "task with id: '%s' must be created first", s.tid)
}
return raw.(shimPod), nil
} | [
"func",
"(",
"s",
"*",
"service",
")",
"getPod",
"(",
")",
"(",
"shimPod",
",",
"error",
")",
"{",
"raw",
":=",
"s",
".",
"taskOrPod",
".",
"Load",
"(",
")",
"\n",
"if",
"raw",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"Wrapf",
"("... | // getPod returns the pod this shim is tracking or else returns `nil`. It is the
// callers responsibility to verify that `s.isSandbox == true` before calling
// this method.
//
//
// If `pod==nil` returns `errdefs.ErrFailedPrecondition`. | [
"getPod",
"returns",
"the",
"pod",
"this",
"shim",
"is",
"tracking",
"or",
"else",
"returns",
"nil",
".",
"It",
"is",
"the",
"callers",
"responsibility",
"to",
"verify",
"that",
"s",
".",
"isSandbox",
"==",
"true",
"before",
"calling",
"this",
"method",
".... | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/cmd/containerd-shim-runhcs-v1/service_internal.go#L32-L38 |
21,704 | Microsoft/hcsshim | cmd/containerd-shim-runhcs-v1/service_internal.go | getTask | func (s *service) getTask(tid string) (shimTask, error) {
raw := s.taskOrPod.Load()
if raw == nil {
return nil, errors.Wrapf(errdefs.ErrNotFound, "task with id: '%s' not found", tid)
}
if s.isSandbox {
p := raw.(shimPod)
return p.GetTask(tid)
}
// When its not a sandbox only the init task is a valid id.
if... | go | func (s *service) getTask(tid string) (shimTask, error) {
raw := s.taskOrPod.Load()
if raw == nil {
return nil, errors.Wrapf(errdefs.ErrNotFound, "task with id: '%s' not found", tid)
}
if s.isSandbox {
p := raw.(shimPod)
return p.GetTask(tid)
}
// When its not a sandbox only the init task is a valid id.
if... | [
"func",
"(",
"s",
"*",
"service",
")",
"getTask",
"(",
"tid",
"string",
")",
"(",
"shimTask",
",",
"error",
")",
"{",
"raw",
":=",
"s",
".",
"taskOrPod",
".",
"Load",
"(",
")",
"\n",
"if",
"raw",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
... | // getTask returns a task matching `tid` or else returns `nil`. This properly
// handles a task in a pod or a singular task shim.
//
// If `tid` is not found will return `errdefs.ErrNotFound`. | [
"getTask",
"returns",
"a",
"task",
"matching",
"tid",
"or",
"else",
"returns",
"nil",
".",
"This",
"properly",
"handles",
"a",
"task",
"in",
"a",
"pod",
"or",
"a",
"singular",
"task",
"shim",
".",
"If",
"tid",
"is",
"not",
"found",
"will",
"return",
"e... | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/cmd/containerd-shim-runhcs-v1/service_internal.go#L44-L58 |
21,705 | Microsoft/hcsshim | internal/cni/registry.go | NewPersistedNamespaceConfig | func NewPersistedNamespaceConfig(namespaceID, containerID string, containerHostUniqueID guid.GUID) *PersistedNamespaceConfig {
return &PersistedNamespaceConfig{
namespaceID: namespaceID,
ContainerID: containerID,
HostUniqueID: containerHostUniqueID,
}
} | go | func NewPersistedNamespaceConfig(namespaceID, containerID string, containerHostUniqueID guid.GUID) *PersistedNamespaceConfig {
return &PersistedNamespaceConfig{
namespaceID: namespaceID,
ContainerID: containerID,
HostUniqueID: containerHostUniqueID,
}
} | [
"func",
"NewPersistedNamespaceConfig",
"(",
"namespaceID",
",",
"containerID",
"string",
",",
"containerHostUniqueID",
"guid",
".",
"GUID",
")",
"*",
"PersistedNamespaceConfig",
"{",
"return",
"&",
"PersistedNamespaceConfig",
"{",
"namespaceID",
":",
"namespaceID",
",",... | // NewPersistedNamespaceConfig creates an in-memory namespace config that can be
// persisted to the registry. | [
"NewPersistedNamespaceConfig",
"creates",
"an",
"in",
"-",
"memory",
"namespace",
"config",
"that",
"can",
"be",
"persisted",
"to",
"the",
"registry",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/cni/registry.go#L27-L33 |
21,706 | Microsoft/hcsshim | internal/cni/registry.go | LoadPersistedNamespaceConfig | func LoadPersistedNamespaceConfig(namespaceID string) (*PersistedNamespaceConfig, error) {
sk, err := regstate.Open(cniRoot, false)
if err != nil {
return nil, err
}
defer sk.Close()
pnc := PersistedNamespaceConfig{
namespaceID: namespaceID,
stored: true,
}
if err := sk.Get(namespaceID, cniKey, &pnc)... | go | func LoadPersistedNamespaceConfig(namespaceID string) (*PersistedNamespaceConfig, error) {
sk, err := regstate.Open(cniRoot, false)
if err != nil {
return nil, err
}
defer sk.Close()
pnc := PersistedNamespaceConfig{
namespaceID: namespaceID,
stored: true,
}
if err := sk.Get(namespaceID, cniKey, &pnc)... | [
"func",
"LoadPersistedNamespaceConfig",
"(",
"namespaceID",
"string",
")",
"(",
"*",
"PersistedNamespaceConfig",
",",
"error",
")",
"{",
"sk",
",",
"err",
":=",
"regstate",
".",
"Open",
"(",
"cniRoot",
",",
"false",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{"... | // LoadPersistedNamespaceConfig loads a persisted config from the registry that matches
// `namespaceID`. If not found returns `regstate.NotFoundError` | [
"LoadPersistedNamespaceConfig",
"loads",
"a",
"persisted",
"config",
"from",
"the",
"registry",
"that",
"matches",
"namespaceID",
".",
"If",
"not",
"found",
"returns",
"regstate",
".",
"NotFoundError"
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/cni/registry.go#L37-L52 |
21,707 | Microsoft/hcsshim | internal/cni/registry.go | Store | func (pnc *PersistedNamespaceConfig) Store() error {
if pnc.namespaceID == "" {
return errors.New("invalid namespaceID ''")
}
if pnc.ContainerID == "" {
return errors.New("invalid containerID ''")
}
empty := guid.GUID{}
if pnc.HostUniqueID == empty {
return errors.New("invalid containerHostUniqueID 'empy'")... | go | func (pnc *PersistedNamespaceConfig) Store() error {
if pnc.namespaceID == "" {
return errors.New("invalid namespaceID ''")
}
if pnc.ContainerID == "" {
return errors.New("invalid containerID ''")
}
empty := guid.GUID{}
if pnc.HostUniqueID == empty {
return errors.New("invalid containerHostUniqueID 'empy'")... | [
"func",
"(",
"pnc",
"*",
"PersistedNamespaceConfig",
")",
"Store",
"(",
")",
"error",
"{",
"if",
"pnc",
".",
"namespaceID",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"pnc",
".",
"ContainerID",... | // Store stores or updates the in-memory config to its registry state. If the
// store failes returns the store error. | [
"Store",
"stores",
"or",
"updates",
"the",
"in",
"-",
"memory",
"config",
"to",
"its",
"registry",
"state",
".",
"If",
"the",
"store",
"failes",
"returns",
"the",
"store",
"error",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/cni/registry.go#L56-L84 |
21,708 | Microsoft/hcsshim | internal/cni/registry.go | Remove | func (pnc *PersistedNamespaceConfig) Remove() error {
if pnc.stored {
sk, err := regstate.Open(cniRoot, false)
if err != nil {
if regstate.IsNotFoundError(err) {
pnc.stored = false
return nil
}
return err
}
defer sk.Close()
if err := sk.Remove(pnc.namespaceID); err != nil {
if regstate.I... | go | func (pnc *PersistedNamespaceConfig) Remove() error {
if pnc.stored {
sk, err := regstate.Open(cniRoot, false)
if err != nil {
if regstate.IsNotFoundError(err) {
pnc.stored = false
return nil
}
return err
}
defer sk.Close()
if err := sk.Remove(pnc.namespaceID); err != nil {
if regstate.I... | [
"func",
"(",
"pnc",
"*",
"PersistedNamespaceConfig",
")",
"Remove",
"(",
")",
"error",
"{",
"if",
"pnc",
".",
"stored",
"{",
"sk",
",",
"err",
":=",
"regstate",
".",
"Open",
"(",
"cniRoot",
",",
"false",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"i... | // Remove removes any persisted state associated with this config. If the config
// is not found in the registery `Remove` returns no error. | [
"Remove",
"removes",
"any",
"persisted",
"state",
"associated",
"with",
"this",
"config",
".",
"If",
"the",
"config",
"is",
"not",
"found",
"in",
"the",
"registery",
"Remove",
"returns",
"no",
"error",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/cni/registry.go#L88-L110 |
21,709 | Microsoft/hcsshim | internal/wclayer/destroylayer.go | DestroyLayer | func DestroyLayer(path string) (err error) {
title := "hcsshim::DestroyLayer"
fields := logrus.Fields{
"path": path,
}
logrus.WithFields(fields).Debug(title)
defer func() {
if err != nil {
fields[logrus.ErrorKey] = err
logrus.WithFields(fields).Error(err)
} else {
logrus.WithFields(fields).Debug(tit... | go | func DestroyLayer(path string) (err error) {
title := "hcsshim::DestroyLayer"
fields := logrus.Fields{
"path": path,
}
logrus.WithFields(fields).Debug(title)
defer func() {
if err != nil {
fields[logrus.ErrorKey] = err
logrus.WithFields(fields).Error(err)
} else {
logrus.WithFields(fields).Debug(tit... | [
"func",
"DestroyLayer",
"(",
"path",
"string",
")",
"(",
"err",
"error",
")",
"{",
"title",
":=",
"\"",
"\"",
"\n",
"fields",
":=",
"logrus",
".",
"Fields",
"{",
"\"",
"\"",
":",
"path",
",",
"}",
"\n",
"logrus",
".",
"WithFields",
"(",
"fields",
"... | // DestroyLayer will remove the on-disk files representing the layer with the given
// path, including that layer's containing folder, if any. | [
"DestroyLayer",
"will",
"remove",
"the",
"on",
"-",
"disk",
"files",
"representing",
"the",
"layer",
"with",
"the",
"given",
"path",
"including",
"that",
"layer",
"s",
"containing",
"folder",
"if",
"any",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/wclayer/destroylayer.go#L10-L30 |
21,710 | Microsoft/hcsshim | pkg/go-runhcs/runhcs_resize-tty.go | ResizeTTY | func (r *Runhcs) ResizeTTY(context context.Context, id string, width, height uint16, opts *ResizeTTYOpts) error {
args := []string{"resize-tty"}
if opts != nil {
oargs, err := opts.args()
if err != nil {
return err
}
args = append(args, oargs...)
}
return r.runOrError(r.command(context, append(args, id, ... | go | func (r *Runhcs) ResizeTTY(context context.Context, id string, width, height uint16, opts *ResizeTTYOpts) error {
args := []string{"resize-tty"}
if opts != nil {
oargs, err := opts.args()
if err != nil {
return err
}
args = append(args, oargs...)
}
return r.runOrError(r.command(context, append(args, id, ... | [
"func",
"(",
"r",
"*",
"Runhcs",
")",
"ResizeTTY",
"(",
"context",
"context",
".",
"Context",
",",
"id",
"string",
",",
"width",
",",
"height",
"uint16",
",",
"opts",
"*",
"ResizeTTYOpts",
")",
"error",
"{",
"args",
":=",
"[",
"]",
"string",
"{",
"\"... | // ResizeTTY updates the terminal size for a container process. | [
"ResizeTTY",
"updates",
"the",
"terminal",
"size",
"for",
"a",
"container",
"process",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/pkg/go-runhcs/runhcs_resize-tty.go#L23-L33 |
21,711 | Microsoft/hcsshim | internal/oci/sandbox.go | GetSandboxTypeAndID | func GetSandboxTypeAndID(specAnnotations map[string]string) (KubernetesContainerType, string, error) {
var ct KubernetesContainerType
if t, ok := specAnnotations[KubernetesContainerTypeAnnotation]; ok {
switch t {
case string(KubernetesContainerTypeContainer):
ct = KubernetesContainerTypeContainer
case strin... | go | func GetSandboxTypeAndID(specAnnotations map[string]string) (KubernetesContainerType, string, error) {
var ct KubernetesContainerType
if t, ok := specAnnotations[KubernetesContainerTypeAnnotation]; ok {
switch t {
case string(KubernetesContainerTypeContainer):
ct = KubernetesContainerTypeContainer
case strin... | [
"func",
"GetSandboxTypeAndID",
"(",
"specAnnotations",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"KubernetesContainerType",
",",
"string",
",",
"error",
")",
"{",
"var",
"ct",
"KubernetesContainerType",
"\n",
"if",
"t",
",",
"ok",
":=",
"specAnnotations",
... | // GetSandboxTypeAndID parses `specAnnotations` searching for the
// `KubernetesContainerTypeAnnotation` and `KubernetesSandboxIDAnnotation`
// annotations and if found validates the set before returning. | [
"GetSandboxTypeAndID",
"parses",
"specAnnotations",
"searching",
"for",
"the",
"KubernetesContainerTypeAnnotation",
"and",
"KubernetesSandboxIDAnnotation",
"annotations",
"and",
"if",
"found",
"validates",
"the",
"set",
"before",
"returning",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/oci/sandbox.go#L33-L59 |
21,712 | Microsoft/hcsshim | internal/safefile/safeopen.go | openRelativeInternal | func openRelativeInternal(path string, root *os.File, accessMask uint32, shareFlags uint32, createDisposition uint32, flags uint32) (*os.File, error) {
var (
h uintptr
iosb ioStatusBlock
oa objectAttributes
)
path16, err := ntRelativePath(path)
if err != nil {
return nil, err
}
if root == nil || ro... | go | func openRelativeInternal(path string, root *os.File, accessMask uint32, shareFlags uint32, createDisposition uint32, flags uint32) (*os.File, error) {
var (
h uintptr
iosb ioStatusBlock
oa objectAttributes
)
path16, err := ntRelativePath(path)
if err != nil {
return nil, err
}
if root == nil || ro... | [
"func",
"openRelativeInternal",
"(",
"path",
"string",
",",
"root",
"*",
"os",
".",
"File",
",",
"accessMask",
"uint32",
",",
"shareFlags",
"uint32",
",",
"createDisposition",
"uint32",
",",
"flags",
"uint32",
")",
"(",
"*",
"os",
".",
"File",
",",
"error"... | // openRelativeInternal opens a relative path from the given root, failing if
// any of the intermediate path components are reparse points. | [
"openRelativeInternal",
"opens",
"a",
"relative",
"path",
"from",
"the",
"given",
"root",
"failing",
"if",
"any",
"of",
"the",
"intermediate",
"path",
"components",
"are",
"reparse",
"points",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/safefile/safeopen.go#L110-L163 |
21,713 | Microsoft/hcsshim | internal/safefile/safeopen.go | OpenRelative | func OpenRelative(path string, root *os.File, accessMask uint32, shareFlags uint32, createDisposition uint32, flags uint32) (*os.File, error) {
f, err := openRelativeInternal(path, root, accessMask, shareFlags, createDisposition, flags)
if err != nil {
err = &os.PathError{Op: "open", Path: filepath.Join(root.Name()... | go | func OpenRelative(path string, root *os.File, accessMask uint32, shareFlags uint32, createDisposition uint32, flags uint32) (*os.File, error) {
f, err := openRelativeInternal(path, root, accessMask, shareFlags, createDisposition, flags)
if err != nil {
err = &os.PathError{Op: "open", Path: filepath.Join(root.Name()... | [
"func",
"OpenRelative",
"(",
"path",
"string",
",",
"root",
"*",
"os",
".",
"File",
",",
"accessMask",
"uint32",
",",
"shareFlags",
"uint32",
",",
"createDisposition",
"uint32",
",",
"flags",
"uint32",
")",
"(",
"*",
"os",
".",
"File",
",",
"error",
")",... | // OpenRelative opens a relative path from the given root, failing if
// any of the intermediate path components are reparse points. | [
"OpenRelative",
"opens",
"a",
"relative",
"path",
"from",
"the",
"given",
"root",
"failing",
"if",
"any",
"of",
"the",
"intermediate",
"path",
"components",
"are",
"reparse",
"points",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/safefile/safeopen.go#L167-L173 |
21,714 | Microsoft/hcsshim | internal/safefile/safeopen.go | deleteOnClose | func deleteOnClose(f *os.File) error {
disposition := fileDispositionInformationEx{Flags: FILE_DISPOSITION_DELETE}
var iosb ioStatusBlock
status := ntSetInformationFile(
f.Fd(),
&iosb,
uintptr(unsafe.Pointer(&disposition)),
uint32(unsafe.Sizeof(disposition)),
_FileDispositionInformationEx,
)
if status !=... | go | func deleteOnClose(f *os.File) error {
disposition := fileDispositionInformationEx{Flags: FILE_DISPOSITION_DELETE}
var iosb ioStatusBlock
status := ntSetInformationFile(
f.Fd(),
&iosb,
uintptr(unsafe.Pointer(&disposition)),
uint32(unsafe.Sizeof(disposition)),
_FileDispositionInformationEx,
)
if status !=... | [
"func",
"deleteOnClose",
"(",
"f",
"*",
"os",
".",
"File",
")",
"error",
"{",
"disposition",
":=",
"fileDispositionInformationEx",
"{",
"Flags",
":",
"FILE_DISPOSITION_DELETE",
"}",
"\n",
"var",
"iosb",
"ioStatusBlock",
"\n",
"status",
":=",
"ntSetInformationFile"... | // deleteOnClose marks a file to be deleted when the handle is closed. | [
"deleteOnClose",
"marks",
"a",
"file",
"to",
"be",
"deleted",
"when",
"the",
"handle",
"is",
"closed",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/safefile/safeopen.go#L254-L268 |
21,715 | Microsoft/hcsshim | internal/safefile/safeopen.go | clearReadOnly | func clearReadOnly(f *os.File) error {
bi, err := winio.GetFileBasicInfo(f)
if err != nil {
return err
}
if bi.FileAttributes&syscall.FILE_ATTRIBUTE_READONLY == 0 {
return nil
}
sbi := winio.FileBasicInfo{
FileAttributes: bi.FileAttributes &^ syscall.FILE_ATTRIBUTE_READONLY,
}
if sbi.FileAttributes == 0 {... | go | func clearReadOnly(f *os.File) error {
bi, err := winio.GetFileBasicInfo(f)
if err != nil {
return err
}
if bi.FileAttributes&syscall.FILE_ATTRIBUTE_READONLY == 0 {
return nil
}
sbi := winio.FileBasicInfo{
FileAttributes: bi.FileAttributes &^ syscall.FILE_ATTRIBUTE_READONLY,
}
if sbi.FileAttributes == 0 {... | [
"func",
"clearReadOnly",
"(",
"f",
"*",
"os",
".",
"File",
")",
"error",
"{",
"bi",
",",
"err",
":=",
"winio",
".",
"GetFileBasicInfo",
"(",
"f",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"bi",
".",
"FileAt... | // clearReadOnly clears the readonly attribute on a file. | [
"clearReadOnly",
"clears",
"the",
"readonly",
"attribute",
"on",
"a",
"file",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/safefile/safeopen.go#L271-L286 |
21,716 | Microsoft/hcsshim | internal/safefile/safeopen.go | RemoveRelative | func RemoveRelative(path string, root *os.File) error {
f, err := openRelativeInternal(
path,
root,
FILE_READ_ATTRIBUTES|FILE_WRITE_ATTRIBUTES|DELETE,
syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
FILE_OPEN,
FILE_OPEN_REPARSE_POINT)
if err == nil {
defer f.Close()
err = d... | go | func RemoveRelative(path string, root *os.File) error {
f, err := openRelativeInternal(
path,
root,
FILE_READ_ATTRIBUTES|FILE_WRITE_ATTRIBUTES|DELETE,
syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
FILE_OPEN,
FILE_OPEN_REPARSE_POINT)
if err == nil {
defer f.Close()
err = d... | [
"func",
"RemoveRelative",
"(",
"path",
"string",
",",
"root",
"*",
"os",
".",
"File",
")",
"error",
"{",
"f",
",",
"err",
":=",
"openRelativeInternal",
"(",
"path",
",",
"root",
",",
"FILE_READ_ATTRIBUTES",
"|",
"FILE_WRITE_ATTRIBUTES",
"|",
"DELETE",
",",
... | // RemoveRelative removes a file or directory relative to a root, failing if any
// intermediate path components are reparse points. | [
"RemoveRelative",
"removes",
"a",
"file",
"or",
"directory",
"relative",
"to",
"a",
"root",
"failing",
"if",
"any",
"intermediate",
"path",
"components",
"are",
"reparse",
"points",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/safefile/safeopen.go#L290-L311 |
21,717 | Microsoft/hcsshim | internal/safefile/safeopen.go | RemoveAllRelative | func RemoveAllRelative(path string, root *os.File) error {
fi, err := LstatRelative(path, root)
if err != nil {
if os.IsNotExist(err) {
return nil
}
return err
}
fileAttributes := fi.Sys().(*syscall.Win32FileAttributeData).FileAttributes
if fileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY == 0 || fileAttri... | go | func RemoveAllRelative(path string, root *os.File) error {
fi, err := LstatRelative(path, root)
if err != nil {
if os.IsNotExist(err) {
return nil
}
return err
}
fileAttributes := fi.Sys().(*syscall.Win32FileAttributeData).FileAttributes
if fileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY == 0 || fileAttri... | [
"func",
"RemoveAllRelative",
"(",
"path",
"string",
",",
"root",
"*",
"os",
".",
"File",
")",
"error",
"{",
"fi",
",",
"err",
":=",
"LstatRelative",
"(",
"path",
",",
"root",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"os",
".",
"IsNotExist",
... | // RemoveAllRelative removes a directory tree relative to a root, failing if any
// intermediate path components are reparse points. | [
"RemoveAllRelative",
"removes",
"a",
"directory",
"tree",
"relative",
"to",
"a",
"root",
"failing",
"if",
"any",
"intermediate",
"path",
"components",
"are",
"reparse",
"points",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/safefile/safeopen.go#L315-L378 |
21,718 | Microsoft/hcsshim | internal/safefile/safeopen.go | MkdirRelative | func MkdirRelative(path string, root *os.File) error {
f, err := openRelativeInternal(
path,
root,
0,
syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
FILE_CREATE,
FILE_DIRECTORY_FILE)
if err == nil {
f.Close()
} else {
err = &os.PathError{Op: "mkdir", Path: filepath.Join(r... | go | func MkdirRelative(path string, root *os.File) error {
f, err := openRelativeInternal(
path,
root,
0,
syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
FILE_CREATE,
FILE_DIRECTORY_FILE)
if err == nil {
f.Close()
} else {
err = &os.PathError{Op: "mkdir", Path: filepath.Join(r... | [
"func",
"MkdirRelative",
"(",
"path",
"string",
",",
"root",
"*",
"os",
".",
"File",
")",
"error",
"{",
"f",
",",
"err",
":=",
"openRelativeInternal",
"(",
"path",
",",
"root",
",",
"0",
",",
"syscall",
".",
"FILE_SHARE_READ",
"|",
"syscall",
".",
"FIL... | // MkdirRelative creates a directory relative to a root, failing if any
// intermediate path components are reparse points. | [
"MkdirRelative",
"creates",
"a",
"directory",
"relative",
"to",
"a",
"root",
"failing",
"if",
"any",
"intermediate",
"path",
"components",
"are",
"reparse",
"points",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/safefile/safeopen.go#L382-L396 |
21,719 | Microsoft/hcsshim | internal/safefile/safeopen.go | LstatRelative | func LstatRelative(path string, root *os.File) (os.FileInfo, error) {
f, err := openRelativeInternal(
path,
root,
FILE_READ_ATTRIBUTES,
syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
FILE_OPEN,
FILE_OPEN_REPARSE_POINT)
if err != nil {
return nil, &os.PathError{Op: "stat", Pa... | go | func LstatRelative(path string, root *os.File) (os.FileInfo, error) {
f, err := openRelativeInternal(
path,
root,
FILE_READ_ATTRIBUTES,
syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
FILE_OPEN,
FILE_OPEN_REPARSE_POINT)
if err != nil {
return nil, &os.PathError{Op: "stat", Pa... | [
"func",
"LstatRelative",
"(",
"path",
"string",
",",
"root",
"*",
"os",
".",
"File",
")",
"(",
"os",
".",
"FileInfo",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"openRelativeInternal",
"(",
"path",
",",
"root",
",",
"FILE_READ_ATTRIBUTES",
",",
"sy... | // LstatRelative performs a stat operation on a file relative to a root, failing
// if any intermediate path components are reparse points. | [
"LstatRelative",
"performs",
"a",
"stat",
"operation",
"on",
"a",
"file",
"relative",
"to",
"a",
"root",
"failing",
"if",
"any",
"intermediate",
"path",
"components",
"are",
"reparse",
"points",
"."
] | 5a7443890943600c562e1f2390ab3fef8c56a45f | https://github.com/Microsoft/hcsshim/blob/5a7443890943600c562e1f2390ab3fef8c56a45f/internal/safefile/safeopen.go#L400-L413 |
21,720 | libopenstorage/openstorage | api/server/sdk/identity.go | Capabilities | func (s *IdentityServer) Capabilities(
ctx context.Context,
req *api.SdkIdentityCapabilitiesRequest,
) (*api.SdkIdentityCapabilitiesResponse, error) {
capCluster := &api.SdkServiceCapability{
Type: &api.SdkServiceCapability_Service{
Service: &api.SdkServiceCapability_OpenStorageService{
Type: api.SdkServic... | go | func (s *IdentityServer) Capabilities(
ctx context.Context,
req *api.SdkIdentityCapabilitiesRequest,
) (*api.SdkIdentityCapabilitiesResponse, error) {
capCluster := &api.SdkServiceCapability{
Type: &api.SdkServiceCapability_Service{
Service: &api.SdkServiceCapability_OpenStorageService{
Type: api.SdkServic... | [
"func",
"(",
"s",
"*",
"IdentityServer",
")",
"Capabilities",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkIdentityCapabilitiesRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkIdentityCapabilitiesResponse",
",",
"error",
")",
"{",
"ca... | // Capabilities returns the capabilities of the SDK server | [
"Capabilities",
"returns",
"the",
"capabilities",
"of",
"the",
"SDK",
"server"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/identity.go#L39-L152 |
21,721 | libopenstorage/openstorage | api/server/sdk/identity.go | Version | func (s *IdentityServer) Version(
ctx context.Context,
req *api.SdkIdentityVersionRequest,
) (*api.SdkIdentityVersionResponse, error) {
var (
version *api.StorageVersion
err error
)
if s.driver(ctx) == nil {
version = &api.StorageVersion{
Driver: "no driver running",
}
} else {
version, err = s.... | go | func (s *IdentityServer) Version(
ctx context.Context,
req *api.SdkIdentityVersionRequest,
) (*api.SdkIdentityVersionResponse, error) {
var (
version *api.StorageVersion
err error
)
if s.driver(ctx) == nil {
version = &api.StorageVersion{
Driver: "no driver running",
}
} else {
version, err = s.... | [
"func",
"(",
"s",
"*",
"IdentityServer",
")",
"Version",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkIdentityVersionRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkIdentityVersionResponse",
",",
"error",
")",
"{",
"var",
"(",
"v... | // Version returns version of the storage system | [
"Version",
"returns",
"version",
"of",
"the",
"storage",
"system"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/identity.go#L155-L193 |
21,722 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | Create | func (s *CloudBackupServer) Create(
ctx context.Context,
req *api.SdkCloudBackupCreateRequest,
) (*api.SdkCloudBackupCreateResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCredentialId()
var err error
if len(req.Ge... | go | func (s *CloudBackupServer) Create(
ctx context.Context,
req *api.SdkCloudBackupCreateRequest,
) (*api.SdkCloudBackupCreateResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCredentialId()
var err error
if len(req.Ge... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"Create",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupCreateRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupCreateResponse",
",",
"error",
")",
"{",
"if",
"s",... | // Create creates a backup for a volume | [
"Create",
"creates",
"a",
"backup",
"for",
"a",
"volume"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L38-L86 |
21,723 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | Restore | func (s *CloudBackupServer) Restore(
ctx context.Context,
req *api.SdkCloudBackupRestoreRequest,
) (*api.SdkCloudBackupRestoreResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCredentialId()
var err error
if len(req.... | go | func (s *CloudBackupServer) Restore(
ctx context.Context,
req *api.SdkCloudBackupRestoreRequest,
) (*api.SdkCloudBackupRestoreResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCredentialId()
var err error
if len(req.... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"Restore",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupRestoreRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupRestoreResponse",
",",
"error",
")",
"{",
"if",
"... | // Restore a backup | [
"Restore",
"a",
"backup"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L89-L129 |
21,724 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | Delete | func (s *CloudBackupServer) Delete(
ctx context.Context,
req *api.SdkCloudBackupDeleteRequest,
) (*api.SdkCloudBackupDeleteResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCredentialId()
var err error
if len(req.Get... | go | func (s *CloudBackupServer) Delete(
ctx context.Context,
req *api.SdkCloudBackupDeleteRequest,
) (*api.SdkCloudBackupDeleteResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCredentialId()
var err error
if len(req.Get... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"Delete",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupDeleteRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupDeleteResponse",
",",
"error",
")",
"{",
"if",
"s",... | // Delete deletes a backup | [
"Delete",
"deletes",
"a",
"backup"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L132-L164 |
21,725 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | DeleteAll | func (s *CloudBackupServer) DeleteAll(
ctx context.Context,
req *api.SdkCloudBackupDeleteAllRequest,
) (*api.SdkCloudBackupDeleteAllResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCredentialId()
var err error
if le... | go | func (s *CloudBackupServer) DeleteAll(
ctx context.Context,
req *api.SdkCloudBackupDeleteAllRequest,
) (*api.SdkCloudBackupDeleteAllResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCredentialId()
var err error
if le... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"DeleteAll",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupDeleteAllRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupDeleteAllResponse",
",",
"error",
")",
"{",
"if... | // DeleteAll deletes all backups for a certain volume | [
"DeleteAll",
"deletes",
"all",
"backups",
"for",
"a",
"certain",
"volume"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L167-L199 |
21,726 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | EnumerateWithFilters | func (s *CloudBackupServer) EnumerateWithFilters(
ctx context.Context,
req *api.SdkCloudBackupEnumerateWithFiltersRequest,
) (*api.SdkCloudBackupEnumerateWithFiltersResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCre... | go | func (s *CloudBackupServer) EnumerateWithFilters(
ctx context.Context,
req *api.SdkCloudBackupEnumerateWithFiltersRequest,
) (*api.SdkCloudBackupEnumerateWithFiltersResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCre... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"EnumerateWithFilters",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupEnumerateWithFiltersRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupEnumerateWithFiltersResponse",
",... | // Enumerate returns information about the backups | [
"Enumerate",
"returns",
"information",
"about",
"the",
"backups"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L202-L235 |
21,727 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | Status | func (s *CloudBackupServer) Status(
ctx context.Context,
req *api.SdkCloudBackupStatusRequest,
) (*api.SdkCloudBackupStatusResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
// Check ownership
if req.GetVolumeId() != "" {
if err := ... | go | func (s *CloudBackupServer) Status(
ctx context.Context,
req *api.SdkCloudBackupStatusRequest,
) (*api.SdkCloudBackupStatusResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
// Check ownership
if req.GetVolumeId() != "" {
if err := ... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"Status",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupStatusRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupStatusResponse",
",",
"error",
")",
"{",
"if",
"s",... | // Status provides status on a backup | [
"Status",
"provides",
"status",
"on",
"a",
"backup"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L238-L272 |
21,728 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | History | func (s *CloudBackupServer) History(
ctx context.Context,
req *api.SdkCloudBackupHistoryRequest,
) (*api.SdkCloudBackupHistoryResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
if len(req.GetSrcVolumeId()) == 0 {
return nil, status.E... | go | func (s *CloudBackupServer) History(
ctx context.Context,
req *api.SdkCloudBackupHistoryRequest,
) (*api.SdkCloudBackupHistoryResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
if len(req.GetSrcVolumeId()) == 0 {
return nil, status.E... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"History",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupHistoryRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupHistoryResponse",
",",
"error",
")",
"{",
"if",
"... | // History returns ?? | [
"History",
"returns",
"??"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L313-L338 |
21,729 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | StateChange | func (s *CloudBackupServer) StateChange(
ctx context.Context,
req *api.SdkCloudBackupStateChangeRequest,
) (*api.SdkCloudBackupStateChangeResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
// TODO
// XXX Get vid from tid
if len(req.... | go | func (s *CloudBackupServer) StateChange(
ctx context.Context,
req *api.SdkCloudBackupStateChangeRequest,
) (*api.SdkCloudBackupStateChangeResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
// TODO
// XXX Get vid from tid
if len(req.... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"StateChange",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupStateChangeRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupStateChangeResponse",
",",
"error",
")",
"{",... | // StateChange pauses and resumes backups | [
"StateChange",
"pauses",
"and",
"resumes",
"backups"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L341-L396 |
21,730 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | SchedCreate | func (s *CloudBackupServer) SchedCreate(
ctx context.Context,
req *api.SdkCloudBackupSchedCreateRequest,
) (*api.SdkCloudBackupSchedCreateResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCloudSchedInfo().GetCredentia... | go | func (s *CloudBackupServer) SchedCreate(
ctx context.Context,
req *api.SdkCloudBackupSchedCreateRequest,
) (*api.SdkCloudBackupSchedCreateResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
credId := req.GetCloudSchedInfo().GetCredentia... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"SchedCreate",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupSchedCreateRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupSchedCreateResponse",
",",
"error",
")",
"{",... | // SchedCreate new schedule for cloud backup | [
"SchedCreate",
"new",
"schedule",
"for",
"cloud",
"backup"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L399-L456 |
21,731 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | SchedDelete | func (s *CloudBackupServer) SchedDelete(
ctx context.Context,
req *api.SdkCloudBackupSchedDeleteRequest,
) (*api.SdkCloudBackupSchedDeleteResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
// TODO
// XXX inspect from uuid and get volu... | go | func (s *CloudBackupServer) SchedDelete(
ctx context.Context,
req *api.SdkCloudBackupSchedDeleteRequest,
) (*api.SdkCloudBackupSchedDeleteResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
// TODO
// XXX inspect from uuid and get volu... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"SchedDelete",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupSchedDeleteRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupSchedDeleteResponse",
",",
"error",
")",
"{",... | // SchedDelete cloud backup schedule | [
"SchedDelete",
"cloud",
"backup",
"schedule"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L459-L482 |
21,732 | libopenstorage/openstorage | api/server/sdk/cloud_backup.go | SchedEnumerate | func (s *CloudBackupServer) SchedEnumerate(
ctx context.Context,
req *api.SdkCloudBackupSchedEnumerateRequest,
) (*api.SdkCloudBackupSchedEnumerateResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
// Pass in ownership and show only va... | go | func (s *CloudBackupServer) SchedEnumerate(
ctx context.Context,
req *api.SdkCloudBackupSchedEnumerateRequest,
) (*api.SdkCloudBackupSchedEnumerateResponse, error) {
if s.driver(ctx) == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
// Pass in ownership and show only va... | [
"func",
"(",
"s",
"*",
"CloudBackupServer",
")",
"SchedEnumerate",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkCloudBackupSchedEnumerateRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkCloudBackupSchedEnumerateResponse",
",",
"error",
")... | // SchedEnumerate cloud backup schedule | [
"SchedEnumerate",
"cloud",
"backup",
"schedule"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cloud_backup.go#L485-L501 |
21,733 | libopenstorage/openstorage | api/server/sdk/cluster.go | InspectCurrent | func (s *ClusterServer) InspectCurrent(
ctx context.Context,
req *api.SdkClusterInspectCurrentRequest,
) (*api.SdkClusterInspectCurrentResponse, error) {
if s.cluster() == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
c, err := s.cluster().Enumerate()
if err != nil {
... | go | func (s *ClusterServer) InspectCurrent(
ctx context.Context,
req *api.SdkClusterInspectCurrentRequest,
) (*api.SdkClusterInspectCurrentResponse, error) {
if s.cluster() == nil {
return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
}
c, err := s.cluster().Enumerate()
if err != nil {
... | [
"func",
"(",
"s",
"*",
"ClusterServer",
")",
"InspectCurrent",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"api",
".",
"SdkClusterInspectCurrentRequest",
",",
")",
"(",
"*",
"api",
".",
"SdkClusterInspectCurrentResponse",
",",
"error",
")",
"{",
... | // InspectCurrent returns information about the current cluster | [
"InspectCurrent",
"returns",
"information",
"about",
"the",
"current",
"cluster"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/cluster.go#L38-L60 |
21,734 | libopenstorage/openstorage | csi/v0.3/controller.go | ControllerGetCapabilities | func (s *OsdCsiServer) ControllerGetCapabilities(
ctx context.Context,
req *csi.ControllerGetCapabilitiesRequest,
) (*csi.ControllerGetCapabilitiesResponse, error) {
// Creating and deleting volumes supported
capCreateDeleteVolume := &csi.ControllerServiceCapability{
Type: &csi.ControllerServiceCapability_Rpc{
... | go | func (s *OsdCsiServer) ControllerGetCapabilities(
ctx context.Context,
req *csi.ControllerGetCapabilitiesRequest,
) (*csi.ControllerGetCapabilitiesResponse, error) {
// Creating and deleting volumes supported
capCreateDeleteVolume := &csi.ControllerServiceCapability{
Type: &csi.ControllerServiceCapability_Rpc{
... | [
"func",
"(",
"s",
"*",
"OsdCsiServer",
")",
"ControllerGetCapabilities",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"csi",
".",
"ControllerGetCapabilitiesRequest",
",",
")",
"(",
"*",
"csi",
".",
"ControllerGetCapabilitiesResponse",
",",
"error",
")... | // ControllerGetCapabilities is a CSI API functions which returns to the caller
// the capabilities of the OSD CSI driver. | [
"ControllerGetCapabilities",
"is",
"a",
"CSI",
"API",
"functions",
"which",
"returns",
"to",
"the",
"caller",
"the",
"capabilities",
"of",
"the",
"OSD",
"CSI",
"driver",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/v0.3/controller.go#L46-L86 |
21,735 | libopenstorage/openstorage | csi/v0.3/controller.go | ControllerPublishVolume | func (s *OsdCsiServer) ControllerPublishVolume(
context.Context,
*csi.ControllerPublishVolumeRequest,
) (*csi.ControllerPublishVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "This request is not supported")
} | go | func (s *OsdCsiServer) ControllerPublishVolume(
context.Context,
*csi.ControllerPublishVolumeRequest,
) (*csi.ControllerPublishVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "This request is not supported")
} | [
"func",
"(",
"s",
"*",
"OsdCsiServer",
")",
"ControllerPublishVolume",
"(",
"context",
".",
"Context",
",",
"*",
"csi",
".",
"ControllerPublishVolumeRequest",
",",
")",
"(",
"*",
"csi",
".",
"ControllerPublishVolumeResponse",
",",
"error",
")",
"{",
"return",
... | // ControllerPublishVolume is a CSI API implements the attachment of a volume
// on to a node. | [
"ControllerPublishVolume",
"is",
"a",
"CSI",
"API",
"implements",
"the",
"attachment",
"of",
"a",
"volume",
"on",
"to",
"a",
"node",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/v0.3/controller.go#L90-L95 |
21,736 | libopenstorage/openstorage | csi/v0.3/controller.go | ControllerUnpublishVolume | func (s *OsdCsiServer) ControllerUnpublishVolume(
context.Context,
*csi.ControllerUnpublishVolumeRequest,
) (*csi.ControllerUnpublishVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "This request is not supported")
} | go | func (s *OsdCsiServer) ControllerUnpublishVolume(
context.Context,
*csi.ControllerUnpublishVolumeRequest,
) (*csi.ControllerUnpublishVolumeResponse, error) {
return nil, status.Error(codes.Unimplemented, "This request is not supported")
} | [
"func",
"(",
"s",
"*",
"OsdCsiServer",
")",
"ControllerUnpublishVolume",
"(",
"context",
".",
"Context",
",",
"*",
"csi",
".",
"ControllerUnpublishVolumeRequest",
",",
")",
"(",
"*",
"csi",
".",
"ControllerUnpublishVolumeResponse",
",",
"error",
")",
"{",
"retur... | // ControllerUnpublishVolume is a CSI API which implements the detaching of a volume
// onto a node. | [
"ControllerUnpublishVolume",
"is",
"a",
"CSI",
"API",
"which",
"implements",
"the",
"detaching",
"of",
"a",
"volume",
"onto",
"a",
"node",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/v0.3/controller.go#L99-L104 |
21,737 | libopenstorage/openstorage | csi/v0.3/controller.go | osdVolumeAttributes | func osdVolumeAttributes(v *api.Volume) map[string]string {
return map[string]string{
api.SpecParent: v.GetSource().GetParent(),
api.SpecSecure: fmt.Sprintf("%v", v.GetSpec().GetEncrypted()),
api.SpecShared: fmt.Sprintf("%v", v.GetSpec().GetShared()),
"readonly": fmt.Sprintf("%v", v.GetReadonly()),
"atta... | go | func osdVolumeAttributes(v *api.Volume) map[string]string {
return map[string]string{
api.SpecParent: v.GetSource().GetParent(),
api.SpecSecure: fmt.Sprintf("%v", v.GetSpec().GetEncrypted()),
api.SpecShared: fmt.Sprintf("%v", v.GetSpec().GetShared()),
"readonly": fmt.Sprintf("%v", v.GetReadonly()),
"atta... | [
"func",
"osdVolumeAttributes",
"(",
"v",
"*",
"api",
".",
"Volume",
")",
"map",
"[",
"string",
"]",
"string",
"{",
"return",
"map",
"[",
"string",
"]",
"string",
"{",
"api",
".",
"SpecParent",
":",
"v",
".",
"GetSource",
"(",
")",
".",
"GetParent",
"... | // osdVolumeAttributes returns the attributes of a volume as a map
// to be returned to the CSI API caller | [
"osdVolumeAttributes",
"returns",
"the",
"attributes",
"of",
"a",
"volume",
"as",
"a",
"map",
"to",
"be",
"returned",
"to",
"the",
"CSI",
"API",
"caller"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/v0.3/controller.go#L294-L304 |
21,738 | libopenstorage/openstorage | pkg/util/volume.go | VolumeFromName | func VolumeFromName(v volume.VolumeDriver, name string) (*api.Volume, error) {
vols, err := v.Inspect([]string{name})
if err == nil && len(vols) == 1 {
return vols[0], nil
}
vols, err = v.Enumerate(&api.VolumeLocator{Name: name}, nil)
if err != nil {
return nil, fmt.Errorf("Failed to locate volume %s. Error: %... | go | func VolumeFromName(v volume.VolumeDriver, name string) (*api.Volume, error) {
vols, err := v.Inspect([]string{name})
if err == nil && len(vols) == 1 {
return vols[0], nil
}
vols, err = v.Enumerate(&api.VolumeLocator{Name: name}, nil)
if err != nil {
return nil, fmt.Errorf("Failed to locate volume %s. Error: %... | [
"func",
"VolumeFromName",
"(",
"v",
"volume",
".",
"VolumeDriver",
",",
"name",
"string",
")",
"(",
"*",
"api",
".",
"Volume",
",",
"error",
")",
"{",
"vols",
",",
"err",
":=",
"v",
".",
"Inspect",
"(",
"[",
"]",
"string",
"{",
"name",
"}",
")",
... | // VolumeFromName returns the volume object associated with the specified name. | [
"VolumeFromName",
"returns",
"the",
"volume",
"object",
"associated",
"with",
"the",
"specified",
"name",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/util/volume.go#L28-L40 |
21,739 | libopenstorage/openstorage | pkg/util/volume.go | VolumeFromIdSdk | func VolumeFromIdSdk(ctx context.Context, volumes api.OpenStorageVolumeClient, id string) (*api.Volume, error) {
inspectResp, err := volumes.Inspect(ctx, &api.SdkVolumeInspectRequest{
VolumeId: id,
})
if err != nil {
return nil, fmt.Errorf("Cannot locate volume with id %s", id)
}
return inspectResp.Volume, nil... | go | func VolumeFromIdSdk(ctx context.Context, volumes api.OpenStorageVolumeClient, id string) (*api.Volume, error) {
inspectResp, err := volumes.Inspect(ctx, &api.SdkVolumeInspectRequest{
VolumeId: id,
})
if err != nil {
return nil, fmt.Errorf("Cannot locate volume with id %s", id)
}
return inspectResp.Volume, nil... | [
"func",
"VolumeFromIdSdk",
"(",
"ctx",
"context",
".",
"Context",
",",
"volumes",
"api",
".",
"OpenStorageVolumeClient",
",",
"id",
"string",
")",
"(",
"*",
"api",
".",
"Volume",
",",
"error",
")",
"{",
"inspectResp",
",",
"err",
":=",
"volumes",
".",
"I... | // VolumeFromIdSdk uses the SDK to fetch the volume object associated with the specified id. | [
"VolumeFromIdSdk",
"uses",
"the",
"SDK",
"to",
"fetch",
"the",
"volume",
"object",
"associated",
"with",
"the",
"specified",
"id",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/util/volume.go#L43-L51 |
21,740 | libopenstorage/openstorage | pkg/util/volume.go | VolumeFromNameSdk | func VolumeFromNameSdk(ctx context.Context, volumes api.OpenStorageVolumeClient, name string) (*api.Volume, error) {
// get volume id
volId, err := VolumeIdFromNameSdk(ctx, volumes, name)
if err != nil {
return nil, err
}
// inspect for actual volume
inspectResp, err := volumes.Inspect(ctx, &api.SdkVolumeInspe... | go | func VolumeFromNameSdk(ctx context.Context, volumes api.OpenStorageVolumeClient, name string) (*api.Volume, error) {
// get volume id
volId, err := VolumeIdFromNameSdk(ctx, volumes, name)
if err != nil {
return nil, err
}
// inspect for actual volume
inspectResp, err := volumes.Inspect(ctx, &api.SdkVolumeInspe... | [
"func",
"VolumeFromNameSdk",
"(",
"ctx",
"context",
".",
"Context",
",",
"volumes",
"api",
".",
"OpenStorageVolumeClient",
",",
"name",
"string",
")",
"(",
"*",
"api",
".",
"Volume",
",",
"error",
")",
"{",
"// get volume id",
"volId",
",",
"err",
":=",
"V... | // VolumeFromNameSdk uses the SDK to fetch the volume associated with a specified name. | [
"VolumeFromNameSdk",
"uses",
"the",
"SDK",
"to",
"fetch",
"the",
"volume",
"associated",
"with",
"a",
"specified",
"name",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/util/volume.go#L68-L83 |
21,741 | libopenstorage/openstorage | pkg/storageops/aws/aws.go | NewEnvClient | func NewEnvClient() (storageops.Ops, error) {
region, err := storageops.GetEnvValueStrict("AWS_REGION")
if err != nil {
return nil, err
}
instance, err := storageops.GetEnvValueStrict("AWS_INSTANCE_NAME")
if err != nil {
return nil, err
}
instanceType, err := storageops.GetEnvValueStrict("AWS_INSTANCE_TYPE... | go | func NewEnvClient() (storageops.Ops, error) {
region, err := storageops.GetEnvValueStrict("AWS_REGION")
if err != nil {
return nil, err
}
instance, err := storageops.GetEnvValueStrict("AWS_INSTANCE_NAME")
if err != nil {
return nil, err
}
instanceType, err := storageops.GetEnvValueStrict("AWS_INSTANCE_TYPE... | [
"func",
"NewEnvClient",
"(",
")",
"(",
"storageops",
".",
"Ops",
",",
"error",
")",
"{",
"region",
",",
"err",
":=",
"storageops",
".",
"GetEnvValueStrict",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",... | // NewEnvClient creates a new AWS storage ops instance using environment vars | [
"NewEnvClient",
"creates",
"a",
"new",
"AWS",
"storage",
"ops",
"instance",
"using",
"environment",
"vars"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/storageops/aws/aws.go#L44-L74 |
21,742 | libopenstorage/openstorage | pkg/storageops/aws/aws.go | NewEc2Storage | func NewEc2Storage(instance, instanceType string, ec2 *ec2.EC2) storageops.Ops {
return &ec2Ops{
instance: instance,
instanceType: instanceType,
ec2: ec2,
}
} | go | func NewEc2Storage(instance, instanceType string, ec2 *ec2.EC2) storageops.Ops {
return &ec2Ops{
instance: instance,
instanceType: instanceType,
ec2: ec2,
}
} | [
"func",
"NewEc2Storage",
"(",
"instance",
",",
"instanceType",
"string",
",",
"ec2",
"*",
"ec2",
".",
"EC2",
")",
"storageops",
".",
"Ops",
"{",
"return",
"&",
"ec2Ops",
"{",
"instance",
":",
"instance",
",",
"instanceType",
":",
"instanceType",
",",
"ec2"... | // NewEc2Storage creates a new aws storage ops instance | [
"NewEc2Storage",
"creates",
"a",
"new",
"aws",
"storage",
"ops",
"instance"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/storageops/aws/aws.go#L77-L83 |
21,743 | libopenstorage/openstorage | pkg/storageops/aws/aws.go | getParentDevice | func (s *ec2Ops) getParentDevice(ipDevPath string) (string, error) {
// Check if the path is a symbolic link
var parentDevPath string
fi, err := os.Lstat(ipDevPath)
if err != nil {
return "", err
}
if fi.Mode()&os.ModeSymlink != 0 {
// input device path is a symbolic link
// get the parent device
output, ... | go | func (s *ec2Ops) getParentDevice(ipDevPath string) (string, error) {
// Check if the path is a symbolic link
var parentDevPath string
fi, err := os.Lstat(ipDevPath)
if err != nil {
return "", err
}
if fi.Mode()&os.ModeSymlink != 0 {
// input device path is a symbolic link
// get the parent device
output, ... | [
"func",
"(",
"s",
"*",
"ec2Ops",
")",
"getParentDevice",
"(",
"ipDevPath",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"// Check if the path is a symbolic link",
"var",
"parentDevPath",
"string",
"\n",
"fi",
",",
"err",
":=",
"os",
".",
"Lstat",
"(... | // getParentDevice returns the parent device of the given device path
// by following the symbolic link. It is expected that the input device
// path exists | [
"getParentDevice",
"returns",
"the",
"parent",
"device",
"of",
"the",
"given",
"device",
"path",
"by",
"following",
"the",
"symbolic",
"link",
".",
"It",
"is",
"expected",
"that",
"the",
"input",
"device",
"path",
"exists"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/storageops/aws/aws.go#L311-L330 |
21,744 | libopenstorage/openstorage | api/client/cluster/osdconfig.go | GetClusterConf | func (c *clusterClient) GetClusterConf() (*osdconfig.ClusterConfig, error) {
config := new(osdconfig.ClusterConfig)
request := c.c.Get().Resource(clusterPath + UriCluster)
if err := request.Do().Unmarshal(config); err != nil {
return nil, err
}
return config, nil
} | go | func (c *clusterClient) GetClusterConf() (*osdconfig.ClusterConfig, error) {
config := new(osdconfig.ClusterConfig)
request := c.c.Get().Resource(clusterPath + UriCluster)
if err := request.Do().Unmarshal(config); err != nil {
return nil, err
}
return config, nil
} | [
"func",
"(",
"c",
"*",
"clusterClient",
")",
"GetClusterConf",
"(",
")",
"(",
"*",
"osdconfig",
".",
"ClusterConfig",
",",
"error",
")",
"{",
"config",
":=",
"new",
"(",
"osdconfig",
".",
"ClusterConfig",
")",
"\n",
"request",
":=",
"c",
".",
"c",
".",... | // osdconfig.ConfigCaller interface compliance | [
"osdconfig",
".",
"ConfigCaller",
"interface",
"compliance"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/cluster/osdconfig.go#L16-L23 |
21,745 | libopenstorage/openstorage | csi/identity.go | GetPluginCapabilities | func (s *OsdCsiServer) GetPluginCapabilities(
ctx context.Context,
req *csi.GetPluginCapabilitiesRequest,
) (*csi.GetPluginCapabilitiesResponse, error) {
return &csi.GetPluginCapabilitiesResponse{
Capabilities: []*csi.PluginCapability{
&csi.PluginCapability{
Type: &csi.PluginCapability_Service_{
Servic... | go | func (s *OsdCsiServer) GetPluginCapabilities(
ctx context.Context,
req *csi.GetPluginCapabilitiesRequest,
) (*csi.GetPluginCapabilitiesResponse, error) {
return &csi.GetPluginCapabilitiesResponse{
Capabilities: []*csi.PluginCapability{
&csi.PluginCapability{
Type: &csi.PluginCapability_Service_{
Servic... | [
"func",
"(",
"s",
"*",
"OsdCsiServer",
")",
"GetPluginCapabilities",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"csi",
".",
"GetPluginCapabilitiesRequest",
",",
")",
"(",
"*",
"csi",
".",
"GetPluginCapabilitiesResponse",
",",
"error",
")",
"{",
... | // GetPluginCapabilities is a CSI API | [
"GetPluginCapabilities",
"is",
"a",
"CSI",
"API"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/identity.go#L30-L52 |
21,746 | libopenstorage/openstorage | csi/identity.go | Probe | func (s *OsdCsiServer) Probe(
ctx context.Context,
req *csi.ProbeRequest,
) (*csi.ProbeResponse, error) {
return &csi.ProbeResponse{}, nil
} | go | func (s *OsdCsiServer) Probe(
ctx context.Context,
req *csi.ProbeRequest,
) (*csi.ProbeResponse, error) {
return &csi.ProbeResponse{}, nil
} | [
"func",
"(",
"s",
"*",
"OsdCsiServer",
")",
"Probe",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"csi",
".",
"ProbeRequest",
",",
")",
"(",
"*",
"csi",
".",
"ProbeResponse",
",",
"error",
")",
"{",
"return",
"&",
"csi",
".",
"ProbeRespons... | // Probe is a CSI API | [
"Probe",
"is",
"a",
"CSI",
"API"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/identity.go#L55-L60 |
21,747 | libopenstorage/openstorage | csi/identity.go | GetPluginInfo | func (s *OsdCsiServer) GetPluginInfo(
ctx context.Context,
req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
return &csi.GetPluginInfoResponse{
Name: csiDriverNamePrefix + s.driver.Name(),
VendorVersion: csiDriverVersion,
// As OSD CSI Driver matures, add here more information
M... | go | func (s *OsdCsiServer) GetPluginInfo(
ctx context.Context,
req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error) {
return &csi.GetPluginInfoResponse{
Name: csiDriverNamePrefix + s.driver.Name(),
VendorVersion: csiDriverVersion,
// As OSD CSI Driver matures, add here more information
M... | [
"func",
"(",
"s",
"*",
"OsdCsiServer",
")",
"GetPluginInfo",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"csi",
".",
"GetPluginInfoRequest",
")",
"(",
"*",
"csi",
".",
"GetPluginInfoResponse",
",",
"error",
")",
"{",
"return",
"&",
"csi",
"."... | // GetPluginInfo is a CSI API which returns the information about the plugin.
// This includes name, version, and any other OSD specific information | [
"GetPluginInfo",
"is",
"a",
"CSI",
"API",
"which",
"returns",
"the",
"information",
"about",
"the",
"plugin",
".",
"This",
"includes",
"name",
"version",
"and",
"any",
"other",
"OSD",
"specific",
"information"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/csi/identity.go#L64-L77 |
21,748 | libopenstorage/openstorage | api/client/client.go | NewClient | func NewClient(host, version, userAgent string) (*Client, error) {
baseURL, err := url.Parse(host)
if err != nil {
return nil, err
}
if baseURL.Path == "" {
baseURL.Path = "/"
}
unix2HTTP(baseURL)
hClient := getHTTPClient(host)
if hClient == nil {
return nil, fmt.Errorf("Unable to parse provided url: %v",... | go | func NewClient(host, version, userAgent string) (*Client, error) {
baseURL, err := url.Parse(host)
if err != nil {
return nil, err
}
if baseURL.Path == "" {
baseURL.Path = "/"
}
unix2HTTP(baseURL)
hClient := getHTTPClient(host)
if hClient == nil {
return nil, fmt.Errorf("Unable to parse provided url: %v",... | [
"func",
"NewClient",
"(",
"host",
",",
"version",
",",
"userAgent",
"string",
")",
"(",
"*",
"Client",
",",
"error",
")",
"{",
"baseURL",
",",
"err",
":=",
"url",
".",
"Parse",
"(",
"host",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",... | // NewClient returns a new REST client for specified server. | [
"NewClient",
"returns",
"a",
"new",
"REST",
"client",
"for",
"specified",
"server",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/client.go#L19-L41 |
21,749 | libopenstorage/openstorage | api/client/client.go | GetUnixServerPath | func GetUnixServerPath(socketName string, paths ...string) string {
serverPath := "unix://"
for _, path := range paths {
serverPath = serverPath + path
}
serverPath = serverPath + socketName + ".sock"
return serverPath
} | go | func GetUnixServerPath(socketName string, paths ...string) string {
serverPath := "unix://"
for _, path := range paths {
serverPath = serverPath + path
}
serverPath = serverPath + socketName + ".sock"
return serverPath
} | [
"func",
"GetUnixServerPath",
"(",
"socketName",
"string",
",",
"paths",
"...",
"string",
")",
"string",
"{",
"serverPath",
":=",
"\"",
"\"",
"\n",
"for",
"_",
",",
"path",
":=",
"range",
"paths",
"{",
"serverPath",
"=",
"serverPath",
"+",
"path",
"\n",
"... | // GetUnixServerPath returns a unix domain socket prepended with the
// provided path. | [
"GetUnixServerPath",
"returns",
"a",
"unix",
"domain",
"socket",
"prepended",
"with",
"the",
"provided",
"path",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/client.go#L70-L77 |
21,750 | libopenstorage/openstorage | api/client/client.go | Get | func (c *Client) Get() *Request {
return NewRequest(c.httpClient, c.base, "GET", c.version, c.authstring, c.userAgent)
} | go | func (c *Client) Get() *Request {
return NewRequest(c.httpClient, c.base, "GET", c.version, c.authstring, c.userAgent)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Get",
"(",
")",
"*",
"Request",
"{",
"return",
"NewRequest",
"(",
"c",
".",
"httpClient",
",",
"c",
".",
"base",
",",
"\"",
"\"",
",",
"c",
".",
"version",
",",
"c",
".",
"authstring",
",",
"c",
".",
"user... | // Get returns a Request object setup for GET call. | [
"Get",
"returns",
"a",
"Request",
"object",
"setup",
"for",
"GET",
"call",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/client.go#L104-L106 |
21,751 | libopenstorage/openstorage | cli/cluster.go | ClusterCommands | func ClusterCommands() []cli.Command {
c := &clusterClient{}
commands := []cli.Command{
{
Name: "status",
Aliases: []string{"s"},
Usage: "Inspect the cluster",
Action: c.status,
Flags: []cli.Flag{
cli.StringFlag{
Name: "machine,m",
Usage: "Comma separated machine ids, e.g uuid1,... | go | func ClusterCommands() []cli.Command {
c := &clusterClient{}
commands := []cli.Command{
{
Name: "status",
Aliases: []string{"s"},
Usage: "Inspect the cluster",
Action: c.status,
Flags: []cli.Flag{
cli.StringFlag{
Name: "machine,m",
Usage: "Comma separated machine ids, e.g uuid1,... | [
"func",
"ClusterCommands",
"(",
")",
"[",
"]",
"cli",
".",
"Command",
"{",
"c",
":=",
"&",
"clusterClient",
"{",
"}",
"\n\n",
"commands",
":=",
"[",
"]",
"cli",
".",
"Command",
"{",
"{",
"Name",
":",
"\"",
"\"",
",",
"Aliases",
":",
"[",
"]",
"st... | // ClusterCommands exports CLI comamnds for File VolumeDriver | [
"ClusterCommands",
"exports",
"CLI",
"comamnds",
"for",
"File",
"VolumeDriver"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/cli/cluster.go#L147-L222 |
21,752 | libopenstorage/openstorage | pkg/sched/intervals.go | parseDaily | func parseDaily(dailyStr string) (RetainIntervalSpec, error) {
r, daily, err := parseRetainNumber(dailyStr)
if err != nil {
return r, err
}
if daily == "" {
return r, fmt.Errorf("Daily schedule is missing")
}
dt := strings.Split(daily, "@")
h, m, err := timeOfDay(dt[len(dt)-1])
if err != nil {
return Reta... | go | func parseDaily(dailyStr string) (RetainIntervalSpec, error) {
r, daily, err := parseRetainNumber(dailyStr)
if err != nil {
return r, err
}
if daily == "" {
return r, fmt.Errorf("Daily schedule is missing")
}
dt := strings.Split(daily, "@")
h, m, err := timeOfDay(dt[len(dt)-1])
if err != nil {
return Reta... | [
"func",
"parseDaily",
"(",
"dailyStr",
"string",
")",
"(",
"RetainIntervalSpec",
",",
"error",
")",
"{",
"r",
",",
"daily",
",",
"err",
":=",
"parseRetainNumber",
"(",
"dailyStr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"r",
",",
"err",
"\n... | // parseDaily item [@]hh:mm,r | [
"parseDaily",
"item",
"["
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/sched/intervals.go#L407-L422 |
21,753 | libopenstorage/openstorage | pkg/sched/intervals.go | parseWeekly | func parseWeekly(weeklyStr string) (RetainIntervalSpec, error) {
r, weekly, err := parseRetainNumber(weeklyStr)
if err != nil {
return r, err
}
if weekly == "" {
return r, fmt.Errorf("Weekly schedule is missing")
}
dt := strings.Split(weekly, "@")
if len(dt) == 1 {
dt = append(dt, "0:0")
}
if len(dt) != ... | go | func parseWeekly(weeklyStr string) (RetainIntervalSpec, error) {
r, weekly, err := parseRetainNumber(weeklyStr)
if err != nil {
return r, err
}
if weekly == "" {
return r, fmt.Errorf("Weekly schedule is missing")
}
dt := strings.Split(weekly, "@")
if len(dt) == 1 {
dt = append(dt, "0:0")
}
if len(dt) != ... | [
"func",
"parseWeekly",
"(",
"weeklyStr",
"string",
")",
"(",
"RetainIntervalSpec",
",",
"error",
")",
"{",
"r",
",",
"weekly",
",",
"err",
":=",
"parseRetainNumber",
"(",
"weeklyStr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"r",
",",
"err",
... | // parseWeekly item weekday@hh:mm,r | [
"parseWeekly",
"item",
"weekday"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/sched/intervals.go#L425-L448 |
21,754 | libopenstorage/openstorage | pkg/sched/intervals.go | parseMonthly | func parseMonthly(monthlyStr string) (RetainIntervalSpec, error) {
r, monthly, err := parseRetainNumber(monthlyStr)
if err != nil {
return r, err
}
if monthly == "" {
return r, fmt.Errorf("Monthly schedule is missing")
}
dt := strings.Split(monthly, "@")
if len(dt) == 1 {
dt = append(dt, "0:0")
}
if len(... | go | func parseMonthly(monthlyStr string) (RetainIntervalSpec, error) {
r, monthly, err := parseRetainNumber(monthlyStr)
if err != nil {
return r, err
}
if monthly == "" {
return r, fmt.Errorf("Monthly schedule is missing")
}
dt := strings.Split(monthly, "@")
if len(dt) == 1 {
dt = append(dt, "0:0")
}
if len(... | [
"func",
"parseMonthly",
"(",
"monthlyStr",
"string",
")",
"(",
"RetainIntervalSpec",
",",
"error",
")",
"{",
"r",
",",
"monthly",
",",
"err",
":=",
"parseRetainNumber",
"(",
"monthlyStr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"r",
",",
"err... | // parseMonthly item day@hh:mm,r | [
"parseMonthly",
"item",
"day"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/sched/intervals.go#L451-L478 |
21,755 | libopenstorage/openstorage | pkg/sched/intervals.go | NewPolicyTagsFromSlice | func NewPolicyTagsFromSlice(policies []string) (*PolicyTags, error) {
p := &PolicyTags{Names: policies}
return p, p.verifyPolicyTags()
} | go | func NewPolicyTagsFromSlice(policies []string) (*PolicyTags, error) {
p := &PolicyTags{Names: policies}
return p, p.verifyPolicyTags()
} | [
"func",
"NewPolicyTagsFromSlice",
"(",
"policies",
"[",
"]",
"string",
")",
"(",
"*",
"PolicyTags",
",",
"error",
")",
"{",
"p",
":=",
"&",
"PolicyTags",
"{",
"Names",
":",
"policies",
"}",
"\n",
"return",
"p",
",",
"p",
".",
"verifyPolicyTags",
"(",
"... | // NewPolicyTagsFromSlice returns a new object from a string slice of names | [
"NewPolicyTagsFromSlice",
"returns",
"a",
"new",
"object",
"from",
"a",
"string",
"slice",
"of",
"names"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/sched/intervals.go#L603-L606 |
21,756 | libopenstorage/openstorage | volume/drivers/vfs/vfs.go | Init | func Init(params map[string]string) (volume.VolumeDriver, error) {
return &driver{
volume.IONotSupported,
volume.BlockNotSupported,
volume.SnapshotNotSupported,
common.NewDefaultStoreEnumerator(Name, kvdb.Instance()),
volume.StatsNotSupported,
volume.CredsNotSupported,
volume.CloudBackupNotSupported,
v... | go | func Init(params map[string]string) (volume.VolumeDriver, error) {
return &driver{
volume.IONotSupported,
volume.BlockNotSupported,
volume.SnapshotNotSupported,
common.NewDefaultStoreEnumerator(Name, kvdb.Instance()),
volume.StatsNotSupported,
volume.CredsNotSupported,
volume.CloudBackupNotSupported,
v... | [
"func",
"Init",
"(",
"params",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"volume",
".",
"VolumeDriver",
",",
"error",
")",
"{",
"return",
"&",
"driver",
"{",
"volume",
".",
"IONotSupported",
",",
"volume",
".",
"BlockNotSupported",
",",
"volume",
".... | // Init Driver intialization. | [
"Init",
"Driver",
"intialization",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/vfs/vfs.go#L42-L53 |
21,757 | libopenstorage/openstorage | api/client/request.go | Resource | func (r *Request) Resource(resource string) *Request {
if r.err == nil {
r.err = checkSet("resource", &r.resource, resource)
}
return r
} | go | func (r *Request) Resource(resource string) *Request {
if r.err == nil {
r.err = checkSet("resource", &r.resource, resource)
}
return r
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"Resource",
"(",
"resource",
"string",
")",
"*",
"Request",
"{",
"if",
"r",
".",
"err",
"==",
"nil",
"{",
"r",
".",
"err",
"=",
"checkSet",
"(",
"\"",
"\"",
",",
"&",
"r",
".",
"resource",
",",
"resource",
... | // Resource specifies the resource to be accessed. | [
"Resource",
"specifies",
"the",
"resource",
"to",
"be",
"accessed",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L91-L96 |
21,758 | libopenstorage/openstorage | api/client/request.go | Instance | func (r *Request) Instance(instance string) *Request {
if r.err == nil {
r.err = checkExists("resource", "instance")
if r.err == nil {
r.err = checkSet("instance", &r.instance, instance)
}
}
return r
} | go | func (r *Request) Instance(instance string) *Request {
if r.err == nil {
r.err = checkExists("resource", "instance")
if r.err == nil {
r.err = checkSet("instance", &r.instance, instance)
}
}
return r
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"Instance",
"(",
"instance",
"string",
")",
"*",
"Request",
"{",
"if",
"r",
".",
"err",
"==",
"nil",
"{",
"r",
".",
"err",
"=",
"checkExists",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"if",
"r",
".",
... | // Instance specifies the instance of the resource to be accessed. | [
"Instance",
"specifies",
"the",
"instance",
"of",
"the",
"resource",
"to",
"be",
"accessed",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L99-L107 |
21,759 | libopenstorage/openstorage | api/client/request.go | UsePath | func (r *Request) UsePath(path string) *Request {
if r.err == nil {
r.err = checkSet("path", &r.path, path)
}
return r
} | go | func (r *Request) UsePath(path string) *Request {
if r.err == nil {
r.err = checkSet("path", &r.path, path)
}
return r
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"UsePath",
"(",
"path",
"string",
")",
"*",
"Request",
"{",
"if",
"r",
".",
"err",
"==",
"nil",
"{",
"r",
".",
"err",
"=",
"checkSet",
"(",
"\"",
"\"",
",",
"&",
"r",
".",
"path",
",",
"path",
")",
"\n",... | // UsePath use the specified path and don't build up a request. | [
"UsePath",
"use",
"the",
"specified",
"path",
"and",
"don",
"t",
"build",
"up",
"a",
"request",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L110-L115 |
21,760 | libopenstorage/openstorage | api/client/request.go | QueryOption | func (r *Request) QueryOption(key string, value string) *Request {
if r.err != nil {
return r
}
if r.params == nil {
r.params = make(url.Values)
}
r.params.Add(string(key), value)
return r
} | go | func (r *Request) QueryOption(key string, value string) *Request {
if r.err != nil {
return r
}
if r.params == nil {
r.params = make(url.Values)
}
r.params.Add(string(key), value)
return r
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"QueryOption",
"(",
"key",
"string",
",",
"value",
"string",
")",
"*",
"Request",
"{",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"r",
"\n",
"}",
"\n",
"if",
"r",
".",
"params",
"==",
"nil",
"{",
"... | // QueryOption adds specified options to query. | [
"QueryOption",
"adds",
"specified",
"options",
"to",
"query",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L118-L127 |
21,761 | libopenstorage/openstorage | api/client/request.go | QueryOptionLabel | func (r *Request) QueryOptionLabel(key string, labels map[string]string) *Request {
if r.err != nil {
return r
}
if b, err := json.Marshal(labels); err != nil {
r.err = err
} else {
if r.params == nil {
r.params = make(url.Values)
}
r.params.Add(string(key), string(b))
}
return r
} | go | func (r *Request) QueryOptionLabel(key string, labels map[string]string) *Request {
if r.err != nil {
return r
}
if b, err := json.Marshal(labels); err != nil {
r.err = err
} else {
if r.params == nil {
r.params = make(url.Values)
}
r.params.Add(string(key), string(b))
}
return r
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"QueryOptionLabel",
"(",
"key",
"string",
",",
"labels",
"map",
"[",
"string",
"]",
"string",
")",
"*",
"Request",
"{",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"r",
"\n",
"}",
"\n",
"if",
"b",
","... | // QueryOptionLabel adds specified label to query. | [
"QueryOptionLabel",
"adds",
"specified",
"label",
"to",
"query",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L130-L143 |
21,762 | libopenstorage/openstorage | api/client/request.go | Body | func (r *Request) Body(v interface{}) *Request {
var err error
if r.err != nil {
return r
}
r.body, err = json.Marshal(v)
if err != nil {
r.err = err
return r
}
return r
} | go | func (r *Request) Body(v interface{}) *Request {
var err error
if r.err != nil {
return r
}
r.body, err = json.Marshal(v)
if err != nil {
r.err = err
return r
}
return r
} | [
"func",
"(",
"r",
"*",
"Request",
")",
"Body",
"(",
"v",
"interface",
"{",
"}",
")",
"*",
"Request",
"{",
"var",
"err",
"error",
"\n",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"r",
"\n",
"}",
"\n",
"r",
".",
"body",
",",
"err",
"=",... | // Body sets the request Body. | [
"Body",
"sets",
"the",
"request",
"Body",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L165-L176 |
21,763 | libopenstorage/openstorage | api/client/request.go | headerVal | func headerVal(key string, resp *http.Response) (int, bool) {
if h := resp.Header.Get(key); len(h) > 0 {
if i, err := strconv.Atoi(h); err == nil {
return i, true
}
}
return 0, false
} | go | func headerVal(key string, resp *http.Response) (int, bool) {
if h := resp.Header.Get(key); len(h) > 0 {
if i, err := strconv.Atoi(h); err == nil {
return i, true
}
}
return 0, false
} | [
"func",
"headerVal",
"(",
"key",
"string",
",",
"resp",
"*",
"http",
".",
"Response",
")",
"(",
"int",
",",
"bool",
")",
"{",
"if",
"h",
":=",
"resp",
".",
"Header",
".",
"Get",
"(",
"key",
")",
";",
"len",
"(",
"h",
")",
">",
"0",
"{",
"if",... | // headerVal for key as an int. Return false if header is not present or valid. | [
"headerVal",
"for",
"key",
"as",
"an",
"int",
".",
"Return",
"false",
"if",
"header",
"is",
"not",
"present",
"or",
"valid",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L209-L216 |
21,764 | libopenstorage/openstorage | api/client/request.go | Do | func (r *Request) Do() *Response {
var (
err error
req *http.Request
resp *http.Response
url string
body []byte
)
if r.err != nil {
return &Response{err: r.err}
}
url = r.URL().String()
req, err = http.NewRequest(r.verb, url, bytes.NewBuffer(r.body))
if err != nil {
return &Response{err: err}
... | go | func (r *Request) Do() *Response {
var (
err error
req *http.Request
resp *http.Response
url string
body []byte
)
if r.err != nil {
return &Response{err: r.err}
}
url = r.URL().String()
req, err = http.NewRequest(r.verb, url, bytes.NewBuffer(r.body))
if err != nil {
return &Response{err: err}
... | [
"func",
"(",
"r",
"*",
"Request",
")",
"Do",
"(",
")",
"*",
"Response",
"{",
"var",
"(",
"err",
"error",
"\n",
"req",
"*",
"http",
".",
"Request",
"\n",
"resp",
"*",
"http",
".",
"Response",
"\n",
"url",
"string",
"\n",
"body",
"[",
"]",
"byte",
... | // Do executes the request and returns a Response. | [
"Do",
"executes",
"the",
"request",
"and",
"returns",
"a",
"Response",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L235-L300 |
21,765 | libopenstorage/openstorage | api/client/request.go | Unmarshal | func (r Response) Unmarshal(v interface{}) error {
if r.err != nil {
return r.err
}
return json.Unmarshal(r.body, v)
} | go | func (r Response) Unmarshal(v interface{}) error {
if r.err != nil {
return r.err
}
return json.Unmarshal(r.body, v)
} | [
"func",
"(",
"r",
"Response",
")",
"Unmarshal",
"(",
"v",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"r",
".",
"err",
"!=",
"nil",
"{",
"return",
"r",
".",
"err",
"\n",
"}",
"\n",
"return",
"json",
".",
"Unmarshal",
"(",
"r",
".",
"body",
... | // Unmarshal result into obj | [
"Unmarshal",
"result",
"into",
"obj"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L326-L331 |
21,766 | libopenstorage/openstorage | api/client/request.go | FormatError | func (r Response) FormatError() error {
if len(r.body) == 0 {
return fmt.Errorf("Error: %v", r.err)
}
return fmt.Errorf("%v", strings.TrimSpace(string(r.body)))
} | go | func (r Response) FormatError() error {
if len(r.body) == 0 {
return fmt.Errorf("Error: %v", r.err)
}
return fmt.Errorf("%v", strings.TrimSpace(string(r.body)))
} | [
"func",
"(",
"r",
"Response",
")",
"FormatError",
"(",
")",
"error",
"{",
"if",
"len",
"(",
"r",
".",
"body",
")",
"==",
"0",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"r",
".",
"err",
")",
"\n",
"}",
"\n",
"return",
"fmt",
"... | // FormatError formats the error | [
"FormatError",
"formats",
"the",
"error"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/client/request.go#L339-L344 |
21,767 | libopenstorage/openstorage | pkg/mount/bind_mount.go | NewBindMounter | func NewBindMounter(
rootSubstrings []string,
mountImpl MountImpl,
allowedDirs []string,
trashLocation string,
) (*bindMounter, error) {
b := &bindMounter{
Mounter: Mounter{
mountImpl: mountImpl,
mounts: make(DeviceMap),
paths: make(PathMap),
allowedDirs: allowedDirs,
kl: ... | go | func NewBindMounter(
rootSubstrings []string,
mountImpl MountImpl,
allowedDirs []string,
trashLocation string,
) (*bindMounter, error) {
b := &bindMounter{
Mounter: Mounter{
mountImpl: mountImpl,
mounts: make(DeviceMap),
paths: make(PathMap),
allowedDirs: allowedDirs,
kl: ... | [
"func",
"NewBindMounter",
"(",
"rootSubstrings",
"[",
"]",
"string",
",",
"mountImpl",
"MountImpl",
",",
"allowedDirs",
"[",
"]",
"string",
",",
"trashLocation",
"string",
",",
")",
"(",
"*",
"bindMounter",
",",
"error",
")",
"{",
"b",
":=",
"&",
"bindMoun... | // NewBindMounter returns a new bindMounter | [
"NewBindMounter",
"returns",
"a",
"new",
"bindMounter"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/mount/bind_mount.go#L22-L42 |
21,768 | libopenstorage/openstorage | pkg/options/options.go | IsBoolOptionSet | func IsBoolOptionSet(options map[string]string, key string) bool {
if options != nil {
if value, ok := options[key]; ok {
if b, err := strconv.ParseBool(value); err == nil {
return b
}
}
}
return false
} | go | func IsBoolOptionSet(options map[string]string, key string) bool {
if options != nil {
if value, ok := options[key]; ok {
if b, err := strconv.ParseBool(value); err == nil {
return b
}
}
}
return false
} | [
"func",
"IsBoolOptionSet",
"(",
"options",
"map",
"[",
"string",
"]",
"string",
",",
"key",
"string",
")",
"bool",
"{",
"if",
"options",
"!=",
"nil",
"{",
"if",
"value",
",",
"ok",
":=",
"options",
"[",
"key",
"]",
";",
"ok",
"{",
"if",
"b",
",",
... | // IsBoolOptionSet checks if a boolean option key is set | [
"IsBoolOptionSet",
"checks",
"if",
"a",
"boolean",
"option",
"key",
"is",
"set"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/options/options.go#L57-L67 |
21,769 | libopenstorage/openstorage | pkg/options/options.go | NewVolumeAttachOptions | func NewVolumeAttachOptions(options map[string]string) *api.SdkVolumeAttachOptions {
return &api.SdkVolumeAttachOptions{
SecretName: options[OptionsSecret],
SecretKey: options[OptionsSecretKey],
SecretContext: options[OptionsSecretContext],
}
} | go | func NewVolumeAttachOptions(options map[string]string) *api.SdkVolumeAttachOptions {
return &api.SdkVolumeAttachOptions{
SecretName: options[OptionsSecret],
SecretKey: options[OptionsSecretKey],
SecretContext: options[OptionsSecretContext],
}
} | [
"func",
"NewVolumeAttachOptions",
"(",
"options",
"map",
"[",
"string",
"]",
"string",
")",
"*",
"api",
".",
"SdkVolumeAttachOptions",
"{",
"return",
"&",
"api",
".",
"SdkVolumeAttachOptions",
"{",
"SecretName",
":",
"options",
"[",
"OptionsSecret",
"]",
",",
... | // NewVolumeAttachOptions converts a map of options to api.SdkVolumeAttachOptions | [
"NewVolumeAttachOptions",
"converts",
"a",
"map",
"of",
"options",
"to",
"api",
".",
"SdkVolumeAttachOptions"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/options/options.go#L70-L76 |
21,770 | libopenstorage/openstorage | pkg/options/options.go | NewVolumeUnmountOptions | func NewVolumeUnmountOptions(options map[string]string) *api.SdkVolumeUnmountOptions {
return &api.SdkVolumeUnmountOptions{
DeleteMountPath: IsBoolOptionSet(options, OptionsDeleteAfterUnmount),
NoDelayBeforeDeletingMountPath: IsBoolOptionSet(options, OptionsWaitBeforeDelete),
}
} | go | func NewVolumeUnmountOptions(options map[string]string) *api.SdkVolumeUnmountOptions {
return &api.SdkVolumeUnmountOptions{
DeleteMountPath: IsBoolOptionSet(options, OptionsDeleteAfterUnmount),
NoDelayBeforeDeletingMountPath: IsBoolOptionSet(options, OptionsWaitBeforeDelete),
}
} | [
"func",
"NewVolumeUnmountOptions",
"(",
"options",
"map",
"[",
"string",
"]",
"string",
")",
"*",
"api",
".",
"SdkVolumeUnmountOptions",
"{",
"return",
"&",
"api",
".",
"SdkVolumeUnmountOptions",
"{",
"DeleteMountPath",
":",
"IsBoolOptionSet",
"(",
"options",
",",... | // NewVolumeUnmountOptions converts a map of options to api.SdkVolumeUnmounOptions | [
"NewVolumeUnmountOptions",
"converts",
"a",
"map",
"of",
"options",
"to",
"api",
".",
"SdkVolumeUnmounOptions"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/options/options.go#L79-L84 |
21,771 | libopenstorage/openstorage | graph/drivers/chainfs/chainfs.go | Create | func (d *Driver) Create(id string, parent string, ml string, storageOpts map[string]string) error {
if parent != "" {
logrus.Infof("Creating layer %s with parent %s", id, parent)
} else {
logrus.Infof("Creating parent layer %s", id)
}
cID := C.CString(id)
cParent := C.CString(parent)
ret, err := C.create_la... | go | func (d *Driver) Create(id string, parent string, ml string, storageOpts map[string]string) error {
if parent != "" {
logrus.Infof("Creating layer %s with parent %s", id, parent)
} else {
logrus.Infof("Creating parent layer %s", id)
}
cID := C.CString(id)
cParent := C.CString(parent)
ret, err := C.create_la... | [
"func",
"(",
"d",
"*",
"Driver",
")",
"Create",
"(",
"id",
"string",
",",
"parent",
"string",
",",
"ml",
"string",
",",
"storageOpts",
"map",
"[",
"string",
"]",
"string",
")",
"error",
"{",
"if",
"parent",
"!=",
"\"",
"\"",
"{",
"logrus",
".",
"In... | // Create creates a new, empty, filesystem layer with the
// specified id and parent and mountLabel. Parent and mountLabel may be "". | [
"Create",
"creates",
"a",
"new",
"empty",
"filesystem",
"layer",
"with",
"the",
"specified",
"id",
"and",
"parent",
"and",
"mountLabel",
".",
"Parent",
"and",
"mountLabel",
"may",
"be",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/chainfs/chainfs.go#L80-L97 |
21,772 | libopenstorage/openstorage | graph/drivers/chainfs/chainfs.go | Remove | func (d *Driver) Remove(id string) error {
logrus.Infof("Removing layer %s", id)
cID := C.CString(id)
ret, err := C.remove_layer(cID)
if int(ret) != 0 {
logrus.Warnf("Error while removing layer %s", id)
return err
}
return nil
} | go | func (d *Driver) Remove(id string) error {
logrus.Infof("Removing layer %s", id)
cID := C.CString(id)
ret, err := C.remove_layer(cID)
if int(ret) != 0 {
logrus.Warnf("Error while removing layer %s", id)
return err
}
return nil
} | [
"func",
"(",
"d",
"*",
"Driver",
")",
"Remove",
"(",
"id",
"string",
")",
"error",
"{",
"logrus",
".",
"Infof",
"(",
"\"",
"\"",
",",
"id",
")",
"\n\n",
"cID",
":=",
"C",
".",
"CString",
"(",
"id",
")",
"\n",
"ret",
",",
"err",
":=",
"C",
"."... | // Remove attempts to remove the filesystem layer with this id. | [
"Remove",
"attempts",
"to",
"remove",
"the",
"filesystem",
"layer",
"with",
"this",
"id",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/chainfs/chainfs.go#L100-L111 |
21,773 | libopenstorage/openstorage | graph/drivers/chainfs/chainfs.go | Get | func (d *Driver) Get(id, mountLabel string) (string, error) {
cID := C.CString(id)
ret, err := C.alloc_chainfs(cID)
if int(ret) != 0 {
logrus.Warnf("Error while creating a chain FS for %s", id)
return "", err
} else {
logrus.Debugf("Created a chain FS for %s", id)
chainPath := path.Join(virtPath, id)
ret... | go | func (d *Driver) Get(id, mountLabel string) (string, error) {
cID := C.CString(id)
ret, err := C.alloc_chainfs(cID)
if int(ret) != 0 {
logrus.Warnf("Error while creating a chain FS for %s", id)
return "", err
} else {
logrus.Debugf("Created a chain FS for %s", id)
chainPath := path.Join(virtPath, id)
ret... | [
"func",
"(",
"d",
"*",
"Driver",
")",
"Get",
"(",
"id",
",",
"mountLabel",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"cID",
":=",
"C",
".",
"CString",
"(",
"id",
")",
"\n\n",
"ret",
",",
"err",
":=",
"C",
".",
"alloc_chainfs",
"(",
... | // Get returns the mountpoint for the layered filesystem referred
// to by this id. You can optionally specify a mountLabel or "".
// Returns the absolute path to the mounted layered filesystem. | [
"Get",
"returns",
"the",
"mountpoint",
"for",
"the",
"layered",
"filesystem",
"referred",
"to",
"by",
"this",
"id",
".",
"You",
"can",
"optionally",
"specify",
"a",
"mountLabel",
"or",
".",
"Returns",
"the",
"absolute",
"path",
"to",
"the",
"mounted",
"layer... | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/chainfs/chainfs.go#L122-L134 |
21,774 | libopenstorage/openstorage | graph/drivers/chainfs/chainfs.go | Exists | func (d *Driver) Exists(id string) bool {
path := path.Join(virtPath, id)
_, err := os.Stat(path)
if err == nil {
return true
} else {
return false
}
} | go | func (d *Driver) Exists(id string) bool {
path := path.Join(virtPath, id)
_, err := os.Stat(path)
if err == nil {
return true
} else {
return false
}
} | [
"func",
"(",
"d",
"*",
"Driver",
")",
"Exists",
"(",
"id",
"string",
")",
"bool",
"{",
"path",
":=",
"path",
".",
"Join",
"(",
"virtPath",
",",
"id",
")",
"\n\n",
"_",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"path",
")",
"\n\n",
"if",
"err",
... | // Exists returns whether a filesystem layer with the specified
// ID exists on this driver.
// All cache entries exist. | [
"Exists",
"returns",
"whether",
"a",
"filesystem",
"layer",
"with",
"the",
"specified",
"ID",
"exists",
"on",
"this",
"driver",
".",
"All",
"cache",
"entries",
"exist",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/chainfs/chainfs.go#L152-L162 |
21,775 | libopenstorage/openstorage | graph/drivers/chainfs/chainfs.go | ApplyDiff | func (d *Driver) ApplyDiff(id string, parent string, diff archive.Reader) (size int64, err error) {
dir := path.Join(virtPath, id)
// dir := path.Join("/tmp/chainfs/", id)
logrus.Infof("Applying diff at path %s\n", dir)
if err := chrootarchive.UntarUncompressed(diff, dir, nil); err != nil {
logrus.Warnf("Error ... | go | func (d *Driver) ApplyDiff(id string, parent string, diff archive.Reader) (size int64, err error) {
dir := path.Join(virtPath, id)
// dir := path.Join("/tmp/chainfs/", id)
logrus.Infof("Applying diff at path %s\n", dir)
if err := chrootarchive.UntarUncompressed(diff, dir, nil); err != nil {
logrus.Warnf("Error ... | [
"func",
"(",
"d",
"*",
"Driver",
")",
"ApplyDiff",
"(",
"id",
"string",
",",
"parent",
"string",
",",
"diff",
"archive",
".",
"Reader",
")",
"(",
"size",
"int64",
",",
"err",
"error",
")",
"{",
"dir",
":=",
"path",
".",
"Join",
"(",
"virtPath",
","... | // ApplyDiff extracts the changeset from the given diff into the
// layer with the specified id and parent, returning the size of the
// new layer in bytes.
// The archive.Reader must be an uncompressed stream. | [
"ApplyDiff",
"extracts",
"the",
"changeset",
"from",
"the",
"given",
"diff",
"into",
"the",
"layer",
"with",
"the",
"specified",
"id",
"and",
"parent",
"returning",
"the",
"size",
"of",
"the",
"new",
"layer",
"in",
"bytes",
".",
"The",
"archive",
".",
"Rea... | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/chainfs/chainfs.go#L168-L186 |
21,776 | libopenstorage/openstorage | pkg/jsonpb/jsonpb.go | RegisterSimpleStringEnum | func RegisterSimpleStringEnum(typeName string, typePrefix string, valueMap map[string]int32) {
if _, ok := simpleStringValueMaps[typeName]; ok {
panic("jsonpb: duplicate enum registered: " + typeName)
}
m := make(map[string]int32)
for key, value := range valueMap {
m[strings.TrimPrefix(strings.ToLower(key), fmt... | go | func RegisterSimpleStringEnum(typeName string, typePrefix string, valueMap map[string]int32) {
if _, ok := simpleStringValueMaps[typeName]; ok {
panic("jsonpb: duplicate enum registered: " + typeName)
}
m := make(map[string]int32)
for key, value := range valueMap {
m[strings.TrimPrefix(strings.ToLower(key), fmt... | [
"func",
"RegisterSimpleStringEnum",
"(",
"typeName",
"string",
",",
"typePrefix",
"string",
",",
"valueMap",
"map",
"[",
"string",
"]",
"int32",
")",
"{",
"if",
"_",
",",
"ok",
":=",
"simpleStringValueMaps",
"[",
"typeName",
"]",
";",
"ok",
"{",
"panic",
"... | // RegisterSimpleStringEnum registers a simple string value map. | [
"RegisterSimpleStringEnum",
"registers",
"a",
"simple",
"string",
"value",
"map",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/jsonpb/jsonpb.go#L64-L73 |
21,777 | libopenstorage/openstorage | pkg/jsonpb/jsonpb.go | UnmarshalString | func UnmarshalString(str string, pb proto.Message) error {
return Unmarshal(strings.NewReader(str), pb)
} | go | func UnmarshalString(str string, pb proto.Message) error {
return Unmarshal(strings.NewReader(str), pb)
} | [
"func",
"UnmarshalString",
"(",
"str",
"string",
",",
"pb",
"proto",
".",
"Message",
")",
"error",
"{",
"return",
"Unmarshal",
"(",
"strings",
".",
"NewReader",
"(",
"str",
")",
",",
"pb",
")",
"\n",
"}"
] | // UnmarshalString will populate the fields of a protocol buffer based
// on a JSON string. This function is lenient and will decode any options
// permutations of the related Marshaler. | [
"UnmarshalString",
"will",
"populate",
"the",
"fields",
"of",
"a",
"protocol",
"buffer",
"based",
"on",
"a",
"JSON",
"string",
".",
"This",
"function",
"is",
"lenient",
"and",
"will",
"decode",
"any",
"options",
"permutations",
"of",
"the",
"related",
"Marshal... | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/jsonpb/jsonpb.go#L391-L393 |
21,778 | libopenstorage/openstorage | pkg/jsonpb/jsonpb.go | jsonProperties | func jsonProperties(f reflect.StructField) *proto.Properties {
var prop proto.Properties
prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f)
return &prop
} | go | func jsonProperties(f reflect.StructField) *proto.Properties {
var prop proto.Properties
prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f)
return &prop
} | [
"func",
"jsonProperties",
"(",
"f",
"reflect",
".",
"StructField",
")",
"*",
"proto",
".",
"Properties",
"{",
"var",
"prop",
"proto",
".",
"Properties",
"\n",
"prop",
".",
"Init",
"(",
"f",
".",
"Type",
",",
"f",
".",
"Name",
",",
"f",
".",
"Tag",
... | // jsonProperties returns parsed proto.Properties for the field. | [
"jsonProperties",
"returns",
"parsed",
"proto",
".",
"Properties",
"for",
"the",
"field",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/jsonpb/jsonpb.go#L554-L558 |
21,779 | libopenstorage/openstorage | graph/drivers/layer0/layer0.go | Create | func (l *Layer0) Create(id string, parent string, mountLabel string, storageOpts map[string]string) error {
id, vol, err := l.create(id, parent)
if err != nil {
return err
}
err = l.Driver.Create(id, parent, mountLabel, storageOpts)
if err != nil || vol == nil {
return err
}
// This is layer0. Restore saved ... | go | func (l *Layer0) Create(id string, parent string, mountLabel string, storageOpts map[string]string) error {
id, vol, err := l.create(id, parent)
if err != nil {
return err
}
err = l.Driver.Create(id, parent, mountLabel, storageOpts)
if err != nil || vol == nil {
return err
}
// This is layer0. Restore saved ... | [
"func",
"(",
"l",
"*",
"Layer0",
")",
"Create",
"(",
"id",
"string",
",",
"parent",
"string",
",",
"mountLabel",
"string",
",",
"storageOpts",
"map",
"[",
"string",
"]",
"string",
")",
"error",
"{",
"id",
",",
"vol",
",",
"err",
":=",
"l",
".",
"cr... | // Create creates a new and empty filesystem layer | [
"Create",
"creates",
"a",
"new",
"and",
"empty",
"filesystem",
"layer"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/layer0/layer0.go#L214-L233 |
21,780 | libopenstorage/openstorage | graph/drivers/layer0/layer0.go | Remove | func (l *Layer0) Remove(id string) error {
if !l.isLayer0(id) {
return l.Driver.Remove(l.realID(id))
}
l.Lock()
defer l.Unlock()
var err error
v, ok := l.volumes[id]
if ok {
atomic.AddInt32(&v.ref, -1)
if v.ref == 0 {
// Save the upper dir and blow away the rest.
upperDir := path.Join(path.Join(l.ho... | go | func (l *Layer0) Remove(id string) error {
if !l.isLayer0(id) {
return l.Driver.Remove(l.realID(id))
}
l.Lock()
defer l.Unlock()
var err error
v, ok := l.volumes[id]
if ok {
atomic.AddInt32(&v.ref, -1)
if v.ref == 0 {
// Save the upper dir and blow away the rest.
upperDir := path.Join(path.Join(l.ho... | [
"func",
"(",
"l",
"*",
"Layer0",
")",
"Remove",
"(",
"id",
"string",
")",
"error",
"{",
"if",
"!",
"l",
".",
"isLayer0",
"(",
"id",
")",
"{",
"return",
"l",
".",
"Driver",
".",
"Remove",
"(",
"l",
".",
"realID",
"(",
"id",
")",
")",
"\n",
"}"... | // Remove removes a layer based on its id | [
"Remove",
"removes",
"a",
"layer",
"based",
"on",
"its",
"id"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/layer0/layer0.go#L236-L270 |
21,781 | libopenstorage/openstorage | graph/drivers/layer0/layer0.go | Get | func (l *Layer0) Get(id string, mountLabel string) (string, error) {
id = l.realID(id)
return l.Driver.Get(id, mountLabel)
} | go | func (l *Layer0) Get(id string, mountLabel string) (string, error) {
id = l.realID(id)
return l.Driver.Get(id, mountLabel)
} | [
"func",
"(",
"l",
"*",
"Layer0",
")",
"Get",
"(",
"id",
"string",
",",
"mountLabel",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"id",
"=",
"l",
".",
"realID",
"(",
"id",
")",
"\n",
"return",
"l",
".",
"Driver",
".",
"Get",
"(",
"id",... | // Get returns the mountpoint for the layered filesystem | [
"Get",
"returns",
"the",
"mountpoint",
"for",
"the",
"layered",
"filesystem"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/layer0/layer0.go#L273-L276 |
21,782 | libopenstorage/openstorage | graph/drivers/layer0/layer0.go | Put | func (l *Layer0) Put(id string) error {
id = l.realID(id)
return l.Driver.Put(id)
} | go | func (l *Layer0) Put(id string) error {
id = l.realID(id)
return l.Driver.Put(id)
} | [
"func",
"(",
"l",
"*",
"Layer0",
")",
"Put",
"(",
"id",
"string",
")",
"error",
"{",
"id",
"=",
"l",
".",
"realID",
"(",
"id",
")",
"\n",
"return",
"l",
".",
"Driver",
".",
"Put",
"(",
"id",
")",
"\n",
"}"
] | // Put releases the system resources for the specified id | [
"Put",
"releases",
"the",
"system",
"resources",
"for",
"the",
"specified",
"id"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/layer0/layer0.go#L279-L282 |
21,783 | libopenstorage/openstorage | graph/drivers/layer0/layer0.go | ApplyDiff | func (l *Layer0) ApplyDiff(id string, parent string, diff archive.Reader) (size int64, err error) {
id = l.realID(id)
return l.Driver.ApplyDiff(id, parent, diff)
} | go | func (l *Layer0) ApplyDiff(id string, parent string, diff archive.Reader) (size int64, err error) {
id = l.realID(id)
return l.Driver.ApplyDiff(id, parent, diff)
} | [
"func",
"(",
"l",
"*",
"Layer0",
")",
"ApplyDiff",
"(",
"id",
"string",
",",
"parent",
"string",
",",
"diff",
"archive",
".",
"Reader",
")",
"(",
"size",
"int64",
",",
"err",
"error",
")",
"{",
"id",
"=",
"l",
".",
"realID",
"(",
"id",
")",
"\n",... | // ApplyDiff extracts the changeset between the specified layer and its parent | [
"ApplyDiff",
"extracts",
"the",
"changeset",
"between",
"the",
"specified",
"layer",
"and",
"its",
"parent"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/layer0/layer0.go#L285-L288 |
21,784 | libopenstorage/openstorage | graph/drivers/layer0/layer0.go | Exists | func (l *Layer0) Exists(id string) bool {
id = l.realID(id)
return l.Driver.Exists(id)
} | go | func (l *Layer0) Exists(id string) bool {
id = l.realID(id)
return l.Driver.Exists(id)
} | [
"func",
"(",
"l",
"*",
"Layer0",
")",
"Exists",
"(",
"id",
"string",
")",
"bool",
"{",
"id",
"=",
"l",
".",
"realID",
"(",
"id",
")",
"\n",
"return",
"l",
".",
"Driver",
".",
"Exists",
"(",
"id",
")",
"\n",
"}"
] | // Exists checks if leyr exists | [
"Exists",
"checks",
"if",
"leyr",
"exists"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/layer0/layer0.go#L291-L294 |
21,785 | libopenstorage/openstorage | graph/drivers/layer0/layer0.go | GetMetadata | func (l *Layer0) GetMetadata(id string) (map[string]string, error) {
id = l.realID(id)
return l.Driver.GetMetadata(id)
} | go | func (l *Layer0) GetMetadata(id string) (map[string]string, error) {
id = l.realID(id)
return l.Driver.GetMetadata(id)
} | [
"func",
"(",
"l",
"*",
"Layer0",
")",
"GetMetadata",
"(",
"id",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"string",
",",
"error",
")",
"{",
"id",
"=",
"l",
".",
"realID",
"(",
"id",
")",
"\n",
"return",
"l",
".",
"Driver",
".",
"GetMetadata"... | // GetMetadata returns key-value pairs | [
"GetMetadata",
"returns",
"key",
"-",
"value",
"pairs"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/graph/drivers/layer0/layer0.go#L297-L300 |
21,786 | libopenstorage/openstorage | pkg/auth/userinfo.go | ContextSaveUserInfo | func ContextSaveUserInfo(ctx context.Context, u *UserInfo) context.Context {
return context.WithValue(ctx, InterceptorContextTokenKey, u)
} | go | func ContextSaveUserInfo(ctx context.Context, u *UserInfo) context.Context {
return context.WithValue(ctx, InterceptorContextTokenKey, u)
} | [
"func",
"ContextSaveUserInfo",
"(",
"ctx",
"context",
".",
"Context",
",",
"u",
"*",
"UserInfo",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"InterceptorContextTokenKey",
",",
"u",
")",
"\n",
"}"
] | // ContextSaveUserInfo saves user information in the context for other functions to consume | [
"ContextSaveUserInfo",
"saves",
"user",
"information",
"in",
"the",
"context",
"for",
"other",
"functions",
"to",
"consume"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/userinfo.go#L43-L45 |
21,787 | libopenstorage/openstorage | pkg/auth/userinfo.go | NewUserInfoFromContext | func NewUserInfoFromContext(ctx context.Context) (*UserInfo, bool) {
u, ok := ctx.Value(InterceptorContextTokenKey).(*UserInfo)
return u, ok
} | go | func NewUserInfoFromContext(ctx context.Context) (*UserInfo, bool) {
u, ok := ctx.Value(InterceptorContextTokenKey).(*UserInfo)
return u, ok
} | [
"func",
"NewUserInfoFromContext",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"*",
"UserInfo",
",",
"bool",
")",
"{",
"u",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"InterceptorContextTokenKey",
")",
".",
"(",
"*",
"UserInfo",
")",
"\n",
"return",
... | // NewUserInfoFromContext returns user information in the context if available.
// If not available means that the system is running without auth. | [
"NewUserInfoFromContext",
"returns",
"user",
"information",
"in",
"the",
"context",
"if",
"available",
".",
"If",
"not",
"available",
"means",
"that",
"the",
"system",
"is",
"running",
"without",
"auth",
"."
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/pkg/auth/userinfo.go#L49-L52 |
21,788 | libopenstorage/openstorage | api/server/sdk/server.go | New | func New(config *ServerConfig) (*Server, error) {
if config == nil {
return nil, fmt.Errorf("Must provide configuration")
}
// If no security set, initialize the object as empty
if config.Security == nil {
config.Security = &SecurityConfig{}
}
// Check if the socket is provided to enable the REST gateway t... | go | func New(config *ServerConfig) (*Server, error) {
if config == nil {
return nil, fmt.Errorf("Must provide configuration")
}
// If no security set, initialize the object as empty
if config.Security == nil {
config.Security = &SecurityConfig{}
}
// Check if the socket is provided to enable the REST gateway t... | [
"func",
"New",
"(",
"config",
"*",
"ServerConfig",
")",
"(",
"*",
"Server",
",",
"error",
")",
"{",
"if",
"config",
"==",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// If no security set, initializ... | // New creates a new SDK server | [
"New",
"creates",
"a",
"new",
"SDK",
"server"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/server.go#L183-L252 |
21,789 | libopenstorage/openstorage | api/server/sdk/server.go | Start | func (s *Server) Start() error {
if err := s.netServer.Start(); err != nil {
return err
} else if err := s.udsServer.Start(); err != nil {
return err
} else if err := s.restGateway.Start(); err != nil {
return err
}
return nil
} | go | func (s *Server) Start() error {
if err := s.netServer.Start(); err != nil {
return err
} else if err := s.udsServer.Start(); err != nil {
return err
} else if err := s.restGateway.Start(); err != nil {
return err
}
return nil
} | [
"func",
"(",
"s",
"*",
"Server",
")",
"Start",
"(",
")",
"error",
"{",
"if",
"err",
":=",
"s",
".",
"netServer",
".",
"Start",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"else",
"if",
"err",
":=",
"s",
".",
"udsServer",... | // Start all servers | [
"Start",
"all",
"servers"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/server.go#L255-L265 |
21,790 | libopenstorage/openstorage | api/server/sdk/server.go | UseCluster | func (s *Server) UseCluster(c cluster.Cluster) {
s.netServer.useCluster(c)
s.udsServer.useCluster(c)
} | go | func (s *Server) UseCluster(c cluster.Cluster) {
s.netServer.useCluster(c)
s.udsServer.useCluster(c)
} | [
"func",
"(",
"s",
"*",
"Server",
")",
"UseCluster",
"(",
"c",
"cluster",
".",
"Cluster",
")",
"{",
"s",
".",
"netServer",
".",
"useCluster",
"(",
"c",
")",
"\n",
"s",
".",
"udsServer",
".",
"useCluster",
"(",
"c",
")",
"\n",
"}"
] | // UseCluster will setup a new cluster object for the gRPC handlers | [
"UseCluster",
"will",
"setup",
"a",
"new",
"cluster",
"object",
"for",
"the",
"gRPC",
"handlers"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/server.go#L289-L292 |
21,791 | libopenstorage/openstorage | api/server/sdk/server.go | UseVolumeDrivers | func (s *Server) UseVolumeDrivers(d map[string]volume.VolumeDriver) {
s.netServer.useVolumeDrivers(d)
s.udsServer.useVolumeDrivers(d)
} | go | func (s *Server) UseVolumeDrivers(d map[string]volume.VolumeDriver) {
s.netServer.useVolumeDrivers(d)
s.udsServer.useVolumeDrivers(d)
} | [
"func",
"(",
"s",
"*",
"Server",
")",
"UseVolumeDrivers",
"(",
"d",
"map",
"[",
"string",
"]",
"volume",
".",
"VolumeDriver",
")",
"{",
"s",
".",
"netServer",
".",
"useVolumeDrivers",
"(",
"d",
")",
"\n",
"s",
".",
"udsServer",
".",
"useVolumeDrivers",
... | // UseVolumeDrivers will setup a new driver object for the gRPC handlers | [
"UseVolumeDrivers",
"will",
"setup",
"a",
"new",
"driver",
"object",
"for",
"the",
"gRPC",
"handlers"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/server.go#L295-L298 |
21,792 | libopenstorage/openstorage | api/server/sdk/server.go | UseAlert | func (s *Server) UseAlert(a alerts.FilterDeleter) {
s.netServer.useAlert(a)
s.udsServer.useAlert(a)
} | go | func (s *Server) UseAlert(a alerts.FilterDeleter) {
s.netServer.useAlert(a)
s.udsServer.useAlert(a)
} | [
"func",
"(",
"s",
"*",
"Server",
")",
"UseAlert",
"(",
"a",
"alerts",
".",
"FilterDeleter",
")",
"{",
"s",
".",
"netServer",
".",
"useAlert",
"(",
"a",
")",
"\n",
"s",
".",
"udsServer",
".",
"useAlert",
"(",
"a",
")",
"\n",
"}"
] | // UseAlert will setup a new alert object for the gRPC handlers | [
"UseAlert",
"will",
"setup",
"a",
"new",
"alert",
"object",
"for",
"the",
"gRPC",
"handlers"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/server.go#L301-L304 |
21,793 | libopenstorage/openstorage | api/server/sdk/server.go | newSdkGrpcServer | func newSdkGrpcServer(config *ServerConfig) (*sdkGrpcServer, error) {
if nil == config {
return nil, fmt.Errorf("Configuration must be provided")
}
// Create a log object for this server
name := "SDK-" + config.Net
log := logrus.WithFields(logrus.Fields{
"name": name,
})
// Save the driver for future calls... | go | func newSdkGrpcServer(config *ServerConfig) (*sdkGrpcServer, error) {
if nil == config {
return nil, fmt.Errorf("Configuration must be provided")
}
// Create a log object for this server
name := "SDK-" + config.Net
log := logrus.WithFields(logrus.Fields{
"name": name,
})
// Save the driver for future calls... | [
"func",
"newSdkGrpcServer",
"(",
"config",
"*",
"ServerConfig",
")",
"(",
"*",
"sdkGrpcServer",
",",
"error",
")",
"{",
"if",
"nil",
"==",
"config",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// Create a ... | // New creates a new SDK gRPC server | [
"New",
"creates",
"a",
"new",
"SDK",
"gRPC",
"server"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/api/server/sdk/server.go#L307-L406 |
21,794 | libopenstorage/openstorage | volume/drivers/mock/driver.mock.go | NewMockVolumeDriver | func NewMockVolumeDriver(ctrl *gomock.Controller) *MockVolumeDriver {
mock := &MockVolumeDriver{ctrl: ctrl}
mock.recorder = &MockVolumeDriverMockRecorder{mock}
return mock
} | go | func NewMockVolumeDriver(ctrl *gomock.Controller) *MockVolumeDriver {
mock := &MockVolumeDriver{ctrl: ctrl}
mock.recorder = &MockVolumeDriverMockRecorder{mock}
return mock
} | [
"func",
"NewMockVolumeDriver",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockVolumeDriver",
"{",
"mock",
":=",
"&",
"MockVolumeDriver",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockVolumeDriverMockRecorder",
"{",... | // NewMockVolumeDriver creates a new mock instance | [
"NewMockVolumeDriver",
"creates",
"a",
"new",
"mock",
"instance"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/mock/driver.mock.go#L25-L29 |
21,795 | libopenstorage/openstorage | volume/drivers/mock/driver.mock.go | Attach | func (m *MockVolumeDriver) Attach(arg0 string, arg1 map[string]string) (string, error) {
ret := m.ctrl.Call(m, "Attach", arg0, arg1)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockVolumeDriver) Attach(arg0 string, arg1 map[string]string) (string, error) {
ret := m.ctrl.Call(m, "Attach", arg0, arg1)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockVolumeDriver",
")",
"Attach",
"(",
"arg0",
"string",
",",
"arg1",
"map",
"[",
"string",
"]",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
... | // Attach mocks base method | [
"Attach",
"mocks",
"base",
"method"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/mock/driver.mock.go#L37-L42 |
21,796 | libopenstorage/openstorage | volume/drivers/mock/driver.mock.go | CapacityUsage | func (m *MockVolumeDriver) CapacityUsage(arg0 string) (*api.CapacityUsageResponse, error) {
ret := m.ctrl.Call(m, "CapacityUsage", arg0)
ret0, _ := ret[0].(*api.CapacityUsageResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockVolumeDriver) CapacityUsage(arg0 string) (*api.CapacityUsageResponse, error) {
ret := m.ctrl.Call(m, "CapacityUsage", arg0)
ret0, _ := ret[0].(*api.CapacityUsageResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockVolumeDriver",
")",
"CapacityUsage",
"(",
"arg0",
"string",
")",
"(",
"*",
"api",
".",
"CapacityUsageResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
... | // CapacityUsage mocks base method | [
"CapacityUsage",
"mocks",
"base",
"method"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/mock/driver.mock.go#L50-L55 |
21,797 | libopenstorage/openstorage | volume/drivers/mock/driver.mock.go | Catalog | func (m *MockVolumeDriver) Catalog(arg0, arg1, arg2 string) (api.CatalogResponse, error) {
ret := m.ctrl.Call(m, "Catalog", arg0, arg1, arg2)
ret0, _ := ret[0].(api.CatalogResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockVolumeDriver) Catalog(arg0, arg1, arg2 string) (api.CatalogResponse, error) {
ret := m.ctrl.Call(m, "Catalog", arg0, arg1, arg2)
ret0, _ := ret[0].(api.CatalogResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockVolumeDriver",
")",
"Catalog",
"(",
"arg0",
",",
"arg1",
",",
"arg2",
"string",
")",
"(",
"api",
".",
"CatalogResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",... | // Catalog mocks base method | [
"Catalog",
"mocks",
"base",
"method"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/mock/driver.mock.go#L63-L68 |
21,798 | libopenstorage/openstorage | volume/drivers/mock/driver.mock.go | CloudBackupCatalog | func (m *MockVolumeDriver) CloudBackupCatalog(arg0 *api.CloudBackupCatalogRequest) (*api.CloudBackupCatalogResponse, error) {
ret := m.ctrl.Call(m, "CloudBackupCatalog", arg0)
ret0, _ := ret[0].(*api.CloudBackupCatalogResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockVolumeDriver) CloudBackupCatalog(arg0 *api.CloudBackupCatalogRequest) (*api.CloudBackupCatalogResponse, error) {
ret := m.ctrl.Call(m, "CloudBackupCatalog", arg0)
ret0, _ := ret[0].(*api.CloudBackupCatalogResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockVolumeDriver",
")",
"CloudBackupCatalog",
"(",
"arg0",
"*",
"api",
".",
"CloudBackupCatalogRequest",
")",
"(",
"*",
"api",
".",
"CloudBackupCatalogResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(... | // CloudBackupCatalog mocks base method | [
"CloudBackupCatalog",
"mocks",
"base",
"method"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/mock/driver.mock.go#L76-L81 |
21,799 | libopenstorage/openstorage | volume/drivers/mock/driver.mock.go | CloudBackupCreate | func (m *MockVolumeDriver) CloudBackupCreate(arg0 *api.CloudBackupCreateRequest) (*api.CloudBackupCreateResponse, error) {
ret := m.ctrl.Call(m, "CloudBackupCreate", arg0)
ret0, _ := ret[0].(*api.CloudBackupCreateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockVolumeDriver) CloudBackupCreate(arg0 *api.CloudBackupCreateRequest) (*api.CloudBackupCreateResponse, error) {
ret := m.ctrl.Call(m, "CloudBackupCreate", arg0)
ret0, _ := ret[0].(*api.CloudBackupCreateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockVolumeDriver",
")",
"CloudBackupCreate",
"(",
"arg0",
"*",
"api",
".",
"CloudBackupCreateRequest",
")",
"(",
"*",
"api",
".",
"CloudBackupCreateResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
... | // CloudBackupCreate mocks base method | [
"CloudBackupCreate",
"mocks",
"base",
"method"
] | 71b7f37f99c70e697aa31ca57fa8fb1404629329 | https://github.com/libopenstorage/openstorage/blob/71b7f37f99c70e697aa31ca57fa8fb1404629329/volume/drivers/mock/driver.mock.go#L89-L94 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.