_id stringlengths 2 7 | title stringlengths 1 118 | partition stringclasses 3 values | text stringlengths 52 85.5k | language stringclasses 1 value | meta_information dict |
|---|---|---|---|---|---|
q7100 | PUType | train | func (r *PURuntime) PUType() common.PUType {
r.Lock()
defer r.Unlock()
return r.puType
} | go | {
"resource": ""
} |
q7101 | SetIPAddresses | train | func (r *PURuntime) SetIPAddresses(ipa ExtendedMap) {
r.Lock()
defer r.Unlock()
r.ips = ipa.Copy()
} | go | {
"resource": ""
} |
q7102 | Tag | train | func (r *PURuntime) Tag(key string) (string, bool) {
r.Lock()
defer r.Unlock()
tag, ok := r.tags.Get(key)
return tag, ok
} | go | {
"resource": ""
} |
q7103 | Tags | train | func (r *PURuntime) Tags() *TagStore {
r.Lock()
defer r.Unlock()
return r.tags.Copy()
} | go | {
"resource": ""
} |
q7104 | SetTags | train | func (r *PURuntime) SetTags(t *TagStore) {
r.Lock()
defer r.Unlock()
r.tags.Tags = t.Tags
} | go | {
"resource": ""
} |
q7105 | Options | train | func (r *PURuntime) Options() OptionsType {
r.Lock()
defer r.Unlock()
if r.options == nil {
return OptionsType{}
}
return *r.options
} | go | {
"resource": ""
} |
q7106 | SetServices | train | func (r *PURuntime) SetServices(services []common.Service) {
r.Lock()
defer r.Unlock()
if r.options != nil {
r.options.Services = services
}
} | go | {
"resource": ""
} |
q7107 | PortMap | train | func (r *PURuntime) PortMap() map[nat.Port][]string {
r.Lock()
defer r.Unlock()
if r.options != nil {
return r.options.PortMap
}
return nil
} | go | {
"resource": ""
} |
q7108 | NewNullPKI | train | func NewNullPKI(keyPEM, certPEM, caPEM []byte) (*NullPKI, error) {
p := &NullPKI{}
return p, nil
} | go | {
"resource": ""
} |
q7109 | TCPConnectionExpirationNotifier | train | func TCPConnectionExpirationNotifier(c cache.DataStore, id interface{}, item interface{}) {
if conn, ok := item.(*TCPConnection); ok {
conn.Cleanup(true)
}
} | go | {
"resource": ""
} |
q7110 | String | train | func (c *TCPConnection) String() string {
return fmt.Sprintf("state:%d auth: %+v", c.state, c.Auth)
} | go | {
"resource": ""
} |
q7111 | SetReported | train | func (c *TCPConnection) SetReported(flowState bool) {
c.flowReported++
if c.flowReported > 1 && c.flowLastReporting != flowState {
zap.L().Info("Connection reported multiple times",
zap.Int("report count", c.flowReported),
zap.Bool("previous", c.flowLastReporting),
zap.Bool("next", flowState),
)
}
c.flowLastReporting = flowState
} | go | {
"resource": ""
} |
q7112 | Cleanup | train | func (c *TCPConnection) Cleanup(expiration bool) {
// Logging information
if c.flowReported == 0 {
zap.L().Error("Connection not reported",
zap.String("connection", c.String()))
}
} | go | {
"resource": ""
} |
q7113 | NewTCPConnection | train | func NewTCPConnection(context *pucontext.PUContext, p *packet.Packet) *TCPConnection {
nonce, err := crypto.GenerateRandomBytes(16)
if err != nil {
return nil
}
return &TCPConnection{
state: TCPSynSend,
Context: context,
Auth: AuthInfo{
LocalContext: nonce,
},
}
} | go | {
"resource": ""
} |
q7114 | NewProxyConnection | train | func NewProxyConnection() *ProxyConnection {
nonce, err := crypto.GenerateRandomBytes(16)
if err != nil {
return nil
}
return &ProxyConnection{
state: ClientTokenSend,
Auth: AuthInfo{
LocalContext: nonce,
},
}
} | go | {
"resource": ""
} |
q7115 | NewUDPConnection | train | func NewUDPConnection(context *pucontext.PUContext, writer afinetrawsocket.SocketWriter) *UDPConnection {
nonce, err := crypto.GenerateRandomBytes(16)
if err != nil {
return nil
}
return &UDPConnection{
state: UDPStart,
Context: context,
PacketQueue: make(chan *packet.Packet, MaximumUDPQueueLen),
Writer: writer,
Auth: AuthInfo{
LocalContext: nonce,
},
synStop: make(chan bool),
synAckStop: make(chan bool),
ackStop: make(chan bool),
TestIgnore: true,
}
} | go | {
"resource": ""
} |
q7116 | QueuePackets | train | func (c *UDPConnection) QueuePackets(udpPacket *packet.Packet) (err error) {
buffer := make([]byte, len(udpPacket.GetBuffer(0)))
copy(buffer, udpPacket.GetBuffer(0))
copyPacket, err := packet.New(packet.PacketTypeApplication, buffer, udpPacket.Mark, true)
if err != nil {
return fmt.Errorf("Unable to copy packets to queue:%s", err)
}
select {
case c.PacketQueue <- copyPacket:
default:
// connection object is always locked.
c.udpQueueFullDropCntr++
return fmt.Errorf("Queue is full")
}
return nil
} | go | {
"resource": ""
} |
q7117 | DropPackets | train | func (c *UDPConnection) DropPackets() {
close(c.PacketQueue)
c.PacketQueue = make(chan *packet.Packet, MaximumUDPQueueLen)
} | go | {
"resource": ""
} |
q7118 | ReadPacket | train | func (c *UDPConnection) ReadPacket() *packet.Packet {
select {
case p := <-c.PacketQueue:
return p
default:
return nil
}
} | go | {
"resource": ""
} |
q7119 | updatePUIDCache | train | func (c *cache) updatePUIDCache(podNamespace string, podName string, puID string, dockerRuntime policy.RuntimeReader, kubernetesRuntime policy.RuntimeReader) {
if podNamespace == "" || podName == "" || puID == "" {
return
}
c.Lock()
defer c.Unlock()
kubeIdentifier := kubePodIdentifier(podName, podNamespace)
puidEntry, ok := c.puidCache[puID]
if !ok {
puidEntry = &puidCacheEntry{}
c.puidCache[puID] = puidEntry
}
puidEntry.kubeIdentifier = kubeIdentifier
puidEntry.dockerRuntime = dockerRuntime
puidEntry.kubernetesRuntime = kubernetesRuntime
podEntry, ok := c.podCache[kubeIdentifier]
if !ok {
podEntry = &podCacheEntry{}
podEntry.puIDs = map[string]bool{}
c.podCache[kubeIdentifier] = podEntry
}
podEntry.puIDs[puID] = true
} | go | {
"resource": ""
} |
q7120 | deletePUIDCache | train | func (c *cache) deletePUIDCache(puID string) {
c.Lock()
defer c.Unlock()
// Remove from pod cache.
puidEntry, ok := c.puidCache[puID]
if !ok {
return
}
kubeIdentifier := puidEntry.kubeIdentifier
podEntry, ok := c.podCache[kubeIdentifier]
if !ok {
return
}
delete(podEntry.puIDs, puID)
// if no more containers in the pod, delete the podEntry.
if len(podEntry.puIDs) == 0 {
delete(c.podCache, kubeIdentifier)
}
// delete entry in puidcache
delete(c.puidCache, puID)
} | go | {
"resource": ""
} |
q7121 | getPUIDsbyPod | train | func (c *cache) getPUIDsbyPod(podNamespace string, podName string) []string {
c.RLock()
defer c.RUnlock()
kubeIdentifier := kubePodIdentifier(podName, podNamespace)
podEntry, ok := c.podCache[kubeIdentifier]
if !ok {
return []string{}
}
return keysFromMap(podEntry.puIDs)
} | go | {
"resource": ""
} |
q7122 | deletePodEntry | train | func (c *cache) deletePodEntry(podNamespace string, podName string) {
c.Lock()
defer c.Unlock()
kubeIdentifier := kubePodIdentifier(podName, podNamespace)
delete(c.podCache, kubeIdentifier)
} | go | {
"resource": ""
} |
q7123 | deletePUIDEntry | train | func (c *cache) deletePUIDEntry(puid string) {
c.Lock()
defer c.Unlock()
delete(c.puidCache, puid)
} | go | {
"resource": ""
} |
q7124 | NewMockCgroupnetcls | train | func NewMockCgroupnetcls(ctrl *gomock.Controller) *MockCgroupnetcls {
mock := &MockCgroupnetcls{ctrl: ctrl}
mock.recorder = &MockCgroupnetclsMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
q7125 | Creategroup | train | func (mr *MockCgroupnetclsMockRecorder) Creategroup(cgroupname interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Creategroup", reflect.TypeOf((*MockCgroupnetcls)(nil).Creategroup), cgroupname)
} | go | {
"resource": ""
} |
q7126 | AssignMark | train | func (m *MockCgroupnetcls) AssignMark(cgroupname string, mark uint64) error {
ret := m.ctrl.Call(m, "AssignMark", cgroupname, mark)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7127 | RemoveProcess | train | func (m *MockCgroupnetcls) RemoveProcess(cgroupname string, pid int) error {
ret := m.ctrl.Call(m, "RemoveProcess", cgroupname, pid)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7128 | DeleteCgroup | train | func (m *MockCgroupnetcls) DeleteCgroup(cgroupname string) error {
ret := m.ctrl.Call(m, "DeleteCgroup", cgroupname)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7129 | Deletebasepath | train | func (m *MockCgroupnetcls) Deletebasepath(contextID string) bool {
ret := m.ctrl.Call(m, "Deletebasepath", contextID)
ret0, _ := ret[0].(bool)
return ret0
} | go | {
"resource": ""
} |
q7130 | Deletebasepath | train | func (mr *MockCgroupnetclsMockRecorder) Deletebasepath(contextID interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deletebasepath", reflect.TypeOf((*MockCgroupnetcls)(nil).Deletebasepath), contextID)
} | go | {
"resource": ""
} |
q7131 | ListCgroupProcesses | train | func (m *MockCgroupnetcls) ListCgroupProcesses(cgroupname string) ([]string, error) {
ret := m.ctrl.Call(m, "ListCgroupProcesses", cgroupname)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7132 | ListAllCgroups | train | func (m *MockCgroupnetcls) ListAllCgroups(path string) []string {
ret := m.ctrl.Call(m, "ListAllCgroups", path)
ret0, _ := ret[0].([]string)
return ret0
} | go | {
"resource": ""
} |
q7133 | ListAllCgroups | train | func (mr *MockCgroupnetclsMockRecorder) ListAllCgroups(path interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllCgroups", reflect.TypeOf((*MockCgroupnetcls)(nil).ListAllCgroups), path)
} | go | {
"resource": ""
} |
q7134 | DeepCopy | train | func (c *Configuration) DeepCopy() *Configuration {
return &Configuration{
TCPTargetNetworks: append([]string{}, c.TCPTargetNetworks...),
UDPTargetNetworks: append([]string{}, c.UDPTargetNetworks...),
ExcludedNetworks: append([]string{}, c.ExcludedNetworks...),
}
} | go | {
"resource": ""
} |
q7135 | Stop | train | func (u *uidProcessor) Stop(ctx context.Context, eventInfo *common.EventInfo) error {
puID := eventInfo.PUID
if puID == triremeBaseCgroup {
u.netcls.Deletebasepath(puID)
return nil
}
u.Lock()
defer u.Unlock()
// Take the PID part of the user/pid PUID
var pid string
userID := eventInfo.PUID
parts := strings.SplitN(puID, "/", 2)
if len(parts) == 2 {
userID = parts[0]
pid = parts[1]
}
if len(pid) > 0 {
// Delete the cgroup for that pid
if err := u.netcls.DeleteCgroup(puID); err != nil {
return err
}
if pidlist, err := u.putoPidMap.Get(userID); err == nil {
pidCxt := pidlist.(*puToPidEntry)
iPid, err := strconv.Atoi(pid)
if err != nil {
return err
}
// Clean pid from both caches
delete(pidCxt.pidlist, int32(iPid))
if err = u.pidToPU.Remove(int32(iPid)); err != nil {
zap.L().Warn("Failed to remove entry in the cache", zap.Error(err), zap.String("stopped pid", pid))
}
}
return nil
}
runtime := policy.NewPURuntimeWithDefaults()
runtime.SetPUType(common.UIDLoginPU)
// Since all the PIDs of the user are gone, we can delete the user context.
if err := u.config.Policy.HandlePUEvent(ctx, userID, common.EventStop, runtime); err != nil {
zap.L().Warn("Failed to stop trireme PU ",
zap.String("puID", puID),
zap.Error(err),
)
}
if err := u.config.Policy.HandlePUEvent(ctx, userID, common.EventDestroy, runtime); err != nil {
zap.L().Warn("Failed to Destroy clean trireme ",
zap.String("puID", puID),
zap.Error(err),
)
}
if err := u.putoPidMap.Remove(userID); err != nil {
zap.L().Warn("Failed to remove entry in the cache", zap.Error(err), zap.String("puID", puID))
}
return u.netcls.DeleteCgroup(strings.TrimRight(userID, "/"))
} | go | {
"resource": ""
} |
q7136 | NewMockCommonAPIClient | train | func NewMockCommonAPIClient(ctrl *gomock.Controller) *MockCommonAPIClient {
mock := &MockCommonAPIClient{ctrl: ctrl}
mock.recorder = &MockCommonAPIClientMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
q7137 | ContainerAttach | train | func (mr *MockCommonAPIClientMockRecorder) ContainerAttach(ctx, container, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerAttach", reflect.TypeOf((*MockCommonAPIClient)(nil).ContainerAttach), ctx, container, options)
} | go | {
"resource": ""
} |
q7138 | ContainerCommit | train | func (m *MockCommonAPIClient) ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error) {
ret := m.ctrl.Call(m, "ContainerCommit", ctx, container, options)
ret0, _ := ret[0].(types.IDResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7139 | ContainerExecCreate | train | func (m *MockCommonAPIClient) ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) {
ret := m.ctrl.Call(m, "ContainerExecCreate", ctx, container, config)
ret0, _ := ret[0].(types.IDResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7140 | ContainerExport | train | func (m *MockCommonAPIClient) ContainerExport(ctx context.Context, container string) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "ContainerExport", ctx, container)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7141 | ContainerList | train | func (m *MockCommonAPIClient) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) {
ret := m.ctrl.Call(m, "ContainerList", ctx, options)
ret0, _ := ret[0].([]types.Container)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7142 | ContainerRename | train | func (m *MockCommonAPIClient) ContainerRename(ctx context.Context, container, newContainerName string) error {
ret := m.ctrl.Call(m, "ContainerRename", ctx, container, newContainerName)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7143 | ContainerStats | train | func (m *MockCommonAPIClient) ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error) {
ret := m.ctrl.Call(m, "ContainerStats", ctx, container, stream)
ret0, _ := ret[0].(types.ContainerStats)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7144 | CopyToContainer | train | func (m *MockCommonAPIClient) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error {
ret := m.ctrl.Call(m, "CopyToContainer", ctx, container, path, content, options)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7145 | ImageBuild | train | func (m *MockCommonAPIClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
ret := m.ctrl.Call(m, "ImageBuild", ctx, context, options)
ret0, _ := ret[0].(types.ImageBuildResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7146 | ImageImport | train | func (m *MockCommonAPIClient) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "ImageImport", ctx, source, ref, options)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7147 | ImageInspectWithRaw | train | func (m *MockCommonAPIClient) ImageInspectWithRaw(ctx context.Context, image string) (types.ImageInspect, []byte, error) {
ret := m.ctrl.Call(m, "ImageInspectWithRaw", ctx, image)
ret0, _ := ret[0].(types.ImageInspect)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | {
"resource": ""
} |
q7148 | ImagePull | train | func (m *MockCommonAPIClient) ImagePull(ctx context.Context, ref string, options types.ImagePullOptions) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "ImagePull", ctx, ref, options)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7149 | ImageSave | train | func (m *MockCommonAPIClient) ImageSave(ctx context.Context, images []string) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "ImageSave", ctx, images)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7150 | ImageTag | train | func (m *MockCommonAPIClient) ImageTag(ctx context.Context, image, ref string) error {
ret := m.ctrl.Call(m, "ImageTag", ctx, image, ref)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7151 | NodeInspectWithRaw | train | func (m *MockCommonAPIClient) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) {
ret := m.ctrl.Call(m, "NodeInspectWithRaw", ctx, nodeID)
ret0, _ := ret[0].(swarm.Node)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | {
"resource": ""
} |
q7152 | NodeList | train | func (m *MockCommonAPIClient) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) {
ret := m.ctrl.Call(m, "NodeList", ctx, options)
ret0, _ := ret[0].([]swarm.Node)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7153 | NetworkConnect | train | func (m *MockCommonAPIClient) NetworkConnect(ctx context.Context, networkID, container string, config *network.EndpointSettings) error {
ret := m.ctrl.Call(m, "NetworkConnect", ctx, networkID, container, config)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7154 | NetworkCreate | train | func (m *MockCommonAPIClient) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) {
ret := m.ctrl.Call(m, "NetworkCreate", ctx, name, options)
ret0, _ := ret[0].(types.NetworkCreateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7155 | NetworkDisconnect | train | func (m *MockCommonAPIClient) NetworkDisconnect(ctx context.Context, networkID, container string, force bool) error {
ret := m.ctrl.Call(m, "NetworkDisconnect", ctx, networkID, container, force)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7156 | NetworkList | train | func (m *MockCommonAPIClient) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) {
ret := m.ctrl.Call(m, "NetworkList", ctx, options)
ret0, _ := ret[0].([]types.NetworkResource)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7157 | NetworkRemove | train | func (m *MockCommonAPIClient) NetworkRemove(ctx context.Context, networkID string) error {
ret := m.ctrl.Call(m, "NetworkRemove", ctx, networkID)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7158 | PluginList | train | func (m *MockCommonAPIClient) PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error) {
ret := m.ctrl.Call(m, "PluginList", ctx, filter)
ret0, _ := ret[0].(types.PluginsListResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7159 | PluginInstall | train | func (m *MockCommonAPIClient) PluginInstall(ctx context.Context, name string, options types.PluginInstallOptions) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "PluginInstall", ctx, name, options)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7160 | PluginInspectWithRaw | train | func (m *MockCommonAPIClient) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) {
ret := m.ctrl.Call(m, "PluginInspectWithRaw", ctx, name)
ret0, _ := ret[0].(*types.Plugin)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | {
"resource": ""
} |
q7161 | ServiceList | train | func (m *MockCommonAPIClient) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) {
ret := m.ctrl.Call(m, "ServiceList", ctx, options)
ret0, _ := ret[0].([]swarm.Service)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7162 | ServiceRemove | train | func (m *MockCommonAPIClient) ServiceRemove(ctx context.Context, serviceID string) error {
ret := m.ctrl.Call(m, "ServiceRemove", ctx, serviceID)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7163 | TaskInspectWithRaw | train | func (m *MockCommonAPIClient) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) {
ret := m.ctrl.Call(m, "TaskInspectWithRaw", ctx, taskID)
ret0, _ := ret[0].(swarm.Task)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | {
"resource": ""
} |
q7164 | SwarmJoin | train | func (m *MockCommonAPIClient) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error {
ret := m.ctrl.Call(m, "SwarmJoin", ctx, req)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7165 | SwarmUnlock | train | func (m *MockCommonAPIClient) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error {
ret := m.ctrl.Call(m, "SwarmUnlock", ctx, req)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7166 | SwarmInspect | train | func (m *MockCommonAPIClient) SwarmInspect(ctx context.Context) (swarm.Swarm, error) {
ret := m.ctrl.Call(m, "SwarmInspect", ctx)
ret0, _ := ret[0].(swarm.Swarm)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7167 | SwarmUpdate | train | func (m *MockCommonAPIClient) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error {
ret := m.ctrl.Call(m, "SwarmUpdate", ctx, version, swarm, flags)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7168 | SecretRemove | train | func (m *MockCommonAPIClient) SecretRemove(ctx context.Context, id string) error {
ret := m.ctrl.Call(m, "SecretRemove", ctx, id)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7169 | RegistryLogin | train | func (m *MockCommonAPIClient) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) {
ret := m.ctrl.Call(m, "RegistryLogin", ctx, auth)
ret0, _ := ret[0].(registry.AuthenticateOKBody)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7170 | VolumeCreate | train | func (m *MockCommonAPIClient) VolumeCreate(ctx context.Context, options volume.VolumesCreateBody) (types.Volume, error) {
ret := m.ctrl.Call(m, "VolumeCreate", ctx, options)
ret0, _ := ret[0].(types.Volume)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7171 | VolumeRemove | train | func (m *MockCommonAPIClient) VolumeRemove(ctx context.Context, volumeID string, force bool) error {
ret := m.ctrl.Call(m, "VolumeRemove", ctx, volumeID, force)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7172 | VolumesPrune | train | func (m *MockCommonAPIClient) VolumesPrune(ctx context.Context, pruneFilter filters.Args) (types.VolumesPruneReport, error) {
ret := m.ctrl.Call(m, "VolumesPrune", ctx, pruneFilter)
ret0, _ := ret[0].(types.VolumesPruneReport)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7173 | ClientVersion | train | func (m *MockCommonAPIClient) ClientVersion() string {
ret := m.ctrl.Call(m, "ClientVersion")
ret0, _ := ret[0].(string)
return ret0
} | go | {
"resource": ""
} |
q7174 | ClientVersion | train | func (mr *MockCommonAPIClientMockRecorder) ClientVersion() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientVersion", reflect.TypeOf((*MockCommonAPIClient)(nil).ClientVersion))
} | go | {
"resource": ""
} |
q7175 | UpdateClientVersion | train | func (m *MockCommonAPIClient) UpdateClientVersion(v string) {
m.ctrl.Call(m, "UpdateClientVersion", v)
} | go | {
"resource": ""
} |
q7176 | UpdateClientVersion | train | func (mr *MockCommonAPIClientMockRecorder) UpdateClientVersion(v interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClientVersion", reflect.TypeOf((*MockCommonAPIClient)(nil).UpdateClientVersion), v)
} | go | {
"resource": ""
} |
q7177 | NewMockContainerAPIClient | train | func NewMockContainerAPIClient(ctrl *gomock.Controller) *MockContainerAPIClient {
mock := &MockContainerAPIClient{ctrl: ctrl}
mock.recorder = &MockContainerAPIClientMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
q7178 | ContainerAttach | train | func (m *MockContainerAPIClient) ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) {
ret := m.ctrl.Call(m, "ContainerAttach", ctx, container, options)
ret0, _ := ret[0].(types.HijackedResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7179 | ContainerCreate | train | func (m *MockContainerAPIClient) ContainerCreate(ctx context.Context, config *containerpkg.Config, hostConfig *containerpkg.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (containerpkg.ContainerCreateCreatedBody, error) {
ret := m.ctrl.Call(m, "ContainerCreate", ctx, config, hostConfig, networkingConfig, containerName)
ret0, _ := ret[0].(containerpkg.ContainerCreateCreatedBody)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7180 | ContainerDiff | train | func (m *MockContainerAPIClient) ContainerDiff(ctx context.Context, container string) ([]containerpkg.ContainerChangeResponseItem, error) {
ret := m.ctrl.Call(m, "ContainerDiff", ctx, container)
ret0, _ := ret[0].([]containerpkg.ContainerChangeResponseItem)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7181 | ContainerExecAttach | train | func (m *MockContainerAPIClient) ContainerExecAttach(ctx context.Context, execID string, config types.ExecConfig) (types.HijackedResponse, error) {
ret := m.ctrl.Call(m, "ContainerExecAttach", ctx, execID, config)
ret0, _ := ret[0].(types.HijackedResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7182 | ContainerExecInspect | train | func (m *MockContainerAPIClient) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) {
ret := m.ctrl.Call(m, "ContainerExecInspect", ctx, execID)
ret0, _ := ret[0].(types.ContainerExecInspect)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7183 | ContainerExecResize | train | func (m *MockContainerAPIClient) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error {
ret := m.ctrl.Call(m, "ContainerExecResize", ctx, execID, options)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7184 | ContainerExecStart | train | func (m *MockContainerAPIClient) ContainerExecStart(ctx context.Context, execID string, config types.ExecStartCheck) error {
ret := m.ctrl.Call(m, "ContainerExecStart", ctx, execID, config)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7185 | ContainerInspect | train | func (m *MockContainerAPIClient) ContainerInspect(ctx context.Context, container string) (types.ContainerJSON, error) {
ret := m.ctrl.Call(m, "ContainerInspect", ctx, container)
ret0, _ := ret[0].(types.ContainerJSON)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7186 | ContainerInspect | train | func (mr *MockContainerAPIClientMockRecorder) ContainerInspect(ctx, container interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainerInspect", reflect.TypeOf((*MockContainerAPIClient)(nil).ContainerInspect), ctx, container)
} | go | {
"resource": ""
} |
q7187 | ContainerInspectWithRaw | train | func (m *MockContainerAPIClient) ContainerInspectWithRaw(ctx context.Context, container string, getSize bool) (types.ContainerJSON, []byte, error) {
ret := m.ctrl.Call(m, "ContainerInspectWithRaw", ctx, container, getSize)
ret0, _ := ret[0].(types.ContainerJSON)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | {
"resource": ""
} |
q7188 | ContainerRemove | train | func (m *MockContainerAPIClient) ContainerRemove(ctx context.Context, container string, options types.ContainerRemoveOptions) error {
ret := m.ctrl.Call(m, "ContainerRemove", ctx, container, options)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7189 | ContainerResize | train | func (m *MockContainerAPIClient) ContainerResize(ctx context.Context, container string, options types.ResizeOptions) error {
ret := m.ctrl.Call(m, "ContainerResize", ctx, container, options)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7190 | ContainerRestart | train | func (m *MockContainerAPIClient) ContainerRestart(ctx context.Context, container string, timeout *time.Duration) error {
ret := m.ctrl.Call(m, "ContainerRestart", ctx, container, timeout)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7191 | ContainerStatPath | train | func (m *MockContainerAPIClient) ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) {
ret := m.ctrl.Call(m, "ContainerStatPath", ctx, container, path)
ret0, _ := ret[0].(types.ContainerPathStat)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7192 | ContainerStart | train | func (m *MockContainerAPIClient) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error {
ret := m.ctrl.Call(m, "ContainerStart", ctx, container, options)
ret0, _ := ret[0].(error)
return ret0
} | go | {
"resource": ""
} |
q7193 | ContainerTop | train | func (m *MockContainerAPIClient) ContainerTop(ctx context.Context, container string, arguments []string) (containerpkg.ContainerTopOKBody, error) {
ret := m.ctrl.Call(m, "ContainerTop", ctx, container, arguments)
ret0, _ := ret[0].(containerpkg.ContainerTopOKBody)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7194 | ContainerUpdate | train | func (m *MockContainerAPIClient) ContainerUpdate(ctx context.Context, container string, updateConfig containerpkg.UpdateConfig) (containerpkg.ContainerUpdateOKBody, error) {
ret := m.ctrl.Call(m, "ContainerUpdate", ctx, container, updateConfig)
ret0, _ := ret[0].(containerpkg.ContainerUpdateOKBody)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7195 | ContainerWait | train | func (m *MockContainerAPIClient) ContainerWait(ctx context.Context, container string) (int64, error) {
ret := m.ctrl.Call(m, "ContainerWait", ctx, container)
ret0, _ := ret[0].(int64)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7196 | CopyFromContainer | train | func (m *MockContainerAPIClient) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) {
ret := m.ctrl.Call(m, "CopyFromContainer", ctx, container, srcPath)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(types.ContainerPathStat)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | {
"resource": ""
} |
q7197 | ContainersPrune | train | func (m *MockContainerAPIClient) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) {
ret := m.ctrl.Call(m, "ContainersPrune", ctx, pruneFilters)
ret0, _ := ret[0].(types.ContainersPruneReport)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | {
"resource": ""
} |
q7198 | ContainersPrune | train | func (mr *MockContainerAPIClientMockRecorder) ContainersPrune(ctx, pruneFilters interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainersPrune", reflect.TypeOf((*MockContainerAPIClient)(nil).ContainersPrune), ctx, pruneFilters)
} | go | {
"resource": ""
} |
q7199 | NewMockImageAPIClient | train | func NewMockImageAPIClient(ctrl *gomock.Controller) *MockImageAPIClient {
mock := &MockImageAPIClient{ctrl: ctrl}
mock.recorder = &MockImageAPIClientMockRecorder{mock}
return mock
} | go | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.