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
listlengths 21
1.41k
| docstring
stringlengths 6
2.61k
| docstring_tokens
listlengths 3
215
| sha
stringlengths 40
40
| url
stringlengths 85
252
|
---|---|---|---|---|---|---|---|---|---|---|---|
7,200 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImageCreate | func (m *MockImageAPIClient) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "ImageCreate", ctx, parentReference, options)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockImageAPIClient) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "ImageCreate", ctx, parentReference, options)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockImageAPIClient",
")",
"ImageCreate",
"(",
"ctx",
"context",
".",
"Context",
",",
"parentReference",
"string",
",",
"options",
"types",
".",
"ImageCreateOptions",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"parentReference",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"io",
".",
"ReadCloser",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ImageCreate mocks base method | [
"ImageCreate",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1802-L1807 |
7,201 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImageHistory | func (m *MockImageAPIClient) ImageHistory(ctx context.Context, image string) ([]imagepkg.HistoryResponseItem, error) {
ret := m.ctrl.Call(m, "ImageHistory", ctx, image)
ret0, _ := ret[0].([]imagepkg.HistoryResponseItem)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockImageAPIClient) ImageHistory(ctx context.Context, image string) ([]imagepkg.HistoryResponseItem, error) {
ret := m.ctrl.Call(m, "ImageHistory", ctx, image)
ret0, _ := ret[0].([]imagepkg.HistoryResponseItem)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockImageAPIClient",
")",
"ImageHistory",
"(",
"ctx",
"context",
".",
"Context",
",",
"image",
"string",
")",
"(",
"[",
"]",
"imagepkg",
".",
"HistoryResponseItem",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"image",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"[",
"]",
"imagepkg",
".",
"HistoryResponseItem",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ImageHistory mocks base method | [
"ImageHistory",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1815-L1820 |
7,202 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImageList | func (m *MockImageAPIClient) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) {
ret := m.ctrl.Call(m, "ImageList", ctx, options)
ret0, _ := ret[0].([]types.ImageSummary)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockImageAPIClient) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) {
ret := m.ctrl.Call(m, "ImageList", ctx, options)
ret0, _ := ret[0].([]types.ImageSummary)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockImageAPIClient",
")",
"ImageList",
"(",
"ctx",
"context",
".",
"Context",
",",
"options",
"types",
".",
"ImageListOptions",
")",
"(",
"[",
"]",
"types",
".",
"ImageSummary",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"[",
"]",
"types",
".",
"ImageSummary",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ImageList mocks base method | [
"ImageList",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1855-L1860 |
7,203 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImageLoad | func (m *MockImageAPIClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) {
ret := m.ctrl.Call(m, "ImageLoad", ctx, input, quiet)
ret0, _ := ret[0].(types.ImageLoadResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockImageAPIClient) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) {
ret := m.ctrl.Call(m, "ImageLoad", ctx, input, quiet)
ret0, _ := ret[0].(types.ImageLoadResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockImageAPIClient",
")",
"ImageLoad",
"(",
"ctx",
"context",
".",
"Context",
",",
"input",
"io",
".",
"Reader",
",",
"quiet",
"bool",
")",
"(",
"types",
".",
"ImageLoadResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"input",
",",
"quiet",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"types",
".",
"ImageLoadResponse",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ImageLoad mocks base method | [
"ImageLoad",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1868-L1873 |
7,204 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImageRemove | func (m *MockImageAPIClient) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
ret := m.ctrl.Call(m, "ImageRemove", ctx, image, options)
ret0, _ := ret[0].([]types.ImageDeleteResponseItem)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockImageAPIClient) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
ret := m.ctrl.Call(m, "ImageRemove", ctx, image, options)
ret0, _ := ret[0].([]types.ImageDeleteResponseItem)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockImageAPIClient",
")",
"ImageRemove",
"(",
"ctx",
"context",
".",
"Context",
",",
"image",
"string",
",",
"options",
"types",
".",
"ImageRemoveOptions",
")",
"(",
"[",
"]",
"types",
".",
"ImageDeleteResponseItem",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"image",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"[",
"]",
"types",
".",
"ImageDeleteResponseItem",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ImageRemove mocks base method | [
"ImageRemove",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1907-L1912 |
7,205 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImageSearch | func (m *MockImageAPIClient) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) {
ret := m.ctrl.Call(m, "ImageSearch", ctx, term, options)
ret0, _ := ret[0].([]registry.SearchResult)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockImageAPIClient) ImageSearch(ctx context.Context, term string, options types.ImageSearchOptions) ([]registry.SearchResult, error) {
ret := m.ctrl.Call(m, "ImageSearch", ctx, term, options)
ret0, _ := ret[0].([]registry.SearchResult)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockImageAPIClient",
")",
"ImageSearch",
"(",
"ctx",
"context",
".",
"Context",
",",
"term",
"string",
",",
"options",
"types",
".",
"ImageSearchOptions",
")",
"(",
"[",
"]",
"registry",
".",
"SearchResult",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"term",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"[",
"]",
"registry",
".",
"SearchResult",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ImageSearch mocks base method | [
"ImageSearch",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1920-L1925 |
7,206 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImageSearch | func (mr *MockImageAPIClientMockRecorder) ImageSearch(ctx, term, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSearch", reflect.TypeOf((*MockImageAPIClient)(nil).ImageSearch), ctx, term, options)
} | go | func (mr *MockImageAPIClientMockRecorder) ImageSearch(ctx, term, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSearch", reflect.TypeOf((*MockImageAPIClient)(nil).ImageSearch), ctx, term, options)
} | [
"func",
"(",
"mr",
"*",
"MockImageAPIClientMockRecorder",
")",
"ImageSearch",
"(",
"ctx",
",",
"term",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockImageAPIClient",
")",
"(",
"nil",
")",
".",
"ImageSearch",
")",
",",
"ctx",
",",
"term",
",",
"options",
")",
"\n",
"}"
] | // ImageSearch indicates an expected call of ImageSearch | [
"ImageSearch",
"indicates",
"an",
"expected",
"call",
"of",
"ImageSearch"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1928-L1930 |
7,207 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImageSave | func (mr *MockImageAPIClientMockRecorder) ImageSave(ctx, images interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSave", reflect.TypeOf((*MockImageAPIClient)(nil).ImageSave), ctx, images)
} | go | func (mr *MockImageAPIClientMockRecorder) ImageSave(ctx, images interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImageSave", reflect.TypeOf((*MockImageAPIClient)(nil).ImageSave), ctx, images)
} | [
"func",
"(",
"mr",
"*",
"MockImageAPIClientMockRecorder",
")",
"ImageSave",
"(",
"ctx",
",",
"images",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockImageAPIClient",
")",
"(",
"nil",
")",
".",
"ImageSave",
")",
",",
"ctx",
",",
"images",
")",
"\n",
"}"
] | // ImageSave indicates an expected call of ImageSave | [
"ImageSave",
"indicates",
"an",
"expected",
"call",
"of",
"ImageSave"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1941-L1943 |
7,208 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ImagesPrune | func (mr *MockImageAPIClientMockRecorder) ImagesPrune(ctx, pruneFilter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagesPrune", reflect.TypeOf((*MockImageAPIClient)(nil).ImagesPrune), ctx, pruneFilter)
} | go | func (mr *MockImageAPIClientMockRecorder) ImagesPrune(ctx, pruneFilter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ImagesPrune", reflect.TypeOf((*MockImageAPIClient)(nil).ImagesPrune), ctx, pruneFilter)
} | [
"func",
"(",
"mr",
"*",
"MockImageAPIClientMockRecorder",
")",
"ImagesPrune",
"(",
"ctx",
",",
"pruneFilter",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockImageAPIClient",
")",
"(",
"nil",
")",
".",
"ImagesPrune",
")",
",",
"ctx",
",",
"pruneFilter",
")",
"\n",
"}"
] | // ImagesPrune indicates an expected call of ImagesPrune | [
"ImagesPrune",
"indicates",
"an",
"expected",
"call",
"of",
"ImagesPrune"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1966-L1968 |
7,209 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NewMockNetworkAPIClient | func NewMockNetworkAPIClient(ctrl *gomock.Controller) *MockNetworkAPIClient {
mock := &MockNetworkAPIClient{ctrl: ctrl}
mock.recorder = &MockNetworkAPIClientMockRecorder{mock}
return mock
} | go | func NewMockNetworkAPIClient(ctrl *gomock.Controller) *MockNetworkAPIClient {
mock := &MockNetworkAPIClient{ctrl: ctrl}
mock.recorder = &MockNetworkAPIClientMockRecorder{mock}
return mock
} | [
"func",
"NewMockNetworkAPIClient",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockNetworkAPIClient",
"{",
"mock",
":=",
"&",
"MockNetworkAPIClient",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockNetworkAPIClientMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockNetworkAPIClient creates a new mock instance | [
"NewMockNetworkAPIClient",
"creates",
"a",
"new",
"mock",
"instance"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L1982-L1986 |
7,210 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NetworkConnect | func (mr *MockNetworkAPIClientMockRecorder) NetworkConnect(ctx, networkID, container, config interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworkConnect", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworkConnect), ctx, networkID, container, config)
} | go | func (mr *MockNetworkAPIClientMockRecorder) NetworkConnect(ctx, networkID, container, config interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworkConnect", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworkConnect), ctx, networkID, container, config)
} | [
"func",
"(",
"mr",
"*",
"MockNetworkAPIClientMockRecorder",
")",
"NetworkConnect",
"(",
"ctx",
",",
"networkID",
",",
"container",
",",
"config",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockNetworkAPIClient",
")",
"(",
"nil",
")",
".",
"NetworkConnect",
")",
",",
"ctx",
",",
"networkID",
",",
"container",
",",
"config",
")",
"\n",
"}"
] | // NetworkConnect indicates an expected call of NetworkConnect | [
"NetworkConnect",
"indicates",
"an",
"expected",
"call",
"of",
"NetworkConnect"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2001-L2003 |
7,211 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NetworkCreate | func (mr *MockNetworkAPIClientMockRecorder) NetworkCreate(ctx, name, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworkCreate", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworkCreate), ctx, name, options)
} | go | func (mr *MockNetworkAPIClientMockRecorder) NetworkCreate(ctx, name, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworkCreate", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworkCreate), ctx, name, options)
} | [
"func",
"(",
"mr",
"*",
"MockNetworkAPIClientMockRecorder",
")",
"NetworkCreate",
"(",
"ctx",
",",
"name",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockNetworkAPIClient",
")",
"(",
"nil",
")",
".",
"NetworkCreate",
")",
",",
"ctx",
",",
"name",
",",
"options",
")",
"\n",
"}"
] | // NetworkCreate indicates an expected call of NetworkCreate | [
"NetworkCreate",
"indicates",
"an",
"expected",
"call",
"of",
"NetworkCreate"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2014-L2016 |
7,212 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NetworkInspect | func (m *MockNetworkAPIClient) NetworkInspect(ctx context.Context, networkID string, verbose bool) (types.NetworkResource, error) {
ret := m.ctrl.Call(m, "NetworkInspect", ctx, networkID, verbose)
ret0, _ := ret[0].(types.NetworkResource)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockNetworkAPIClient) NetworkInspect(ctx context.Context, networkID string, verbose bool) (types.NetworkResource, error) {
ret := m.ctrl.Call(m, "NetworkInspect", ctx, networkID, verbose)
ret0, _ := ret[0].(types.NetworkResource)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockNetworkAPIClient",
")",
"NetworkInspect",
"(",
"ctx",
"context",
".",
"Context",
",",
"networkID",
"string",
",",
"verbose",
"bool",
")",
"(",
"types",
".",
"NetworkResource",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"networkID",
",",
"verbose",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"types",
".",
"NetworkResource",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // NetworkInspect mocks base method | [
"NetworkInspect",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2031-L2036 |
7,213 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NetworkInspect | func (mr *MockNetworkAPIClientMockRecorder) NetworkInspect(ctx, networkID, verbose interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworkInspect", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworkInspect), ctx, networkID, verbose)
} | go | func (mr *MockNetworkAPIClientMockRecorder) NetworkInspect(ctx, networkID, verbose interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworkInspect", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworkInspect), ctx, networkID, verbose)
} | [
"func",
"(",
"mr",
"*",
"MockNetworkAPIClientMockRecorder",
")",
"NetworkInspect",
"(",
"ctx",
",",
"networkID",
",",
"verbose",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockNetworkAPIClient",
")",
"(",
"nil",
")",
".",
"NetworkInspect",
")",
",",
"ctx",
",",
"networkID",
",",
"verbose",
")",
"\n",
"}"
] | // NetworkInspect indicates an expected call of NetworkInspect | [
"NetworkInspect",
"indicates",
"an",
"expected",
"call",
"of",
"NetworkInspect"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2039-L2041 |
7,214 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NetworksPrune | func (mr *MockNetworkAPIClientMockRecorder) NetworksPrune(ctx, pruneFilter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworksPrune", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworksPrune), ctx, pruneFilter)
} | go | func (mr *MockNetworkAPIClientMockRecorder) NetworksPrune(ctx, pruneFilter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NetworksPrune", reflect.TypeOf((*MockNetworkAPIClient)(nil).NetworksPrune), ctx, pruneFilter)
} | [
"func",
"(",
"mr",
"*",
"MockNetworkAPIClientMockRecorder",
")",
"NetworksPrune",
"(",
"ctx",
",",
"pruneFilter",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockNetworkAPIClient",
")",
"(",
"nil",
")",
".",
"NetworksPrune",
")",
",",
"ctx",
",",
"pruneFilter",
")",
"\n",
"}"
] | // NetworksPrune indicates an expected call of NetworksPrune | [
"NetworksPrune",
"indicates",
"an",
"expected",
"call",
"of",
"NetworksPrune"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2091-L2093 |
7,215 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NewMockNodeAPIClient | func NewMockNodeAPIClient(ctrl *gomock.Controller) *MockNodeAPIClient {
mock := &MockNodeAPIClient{ctrl: ctrl}
mock.recorder = &MockNodeAPIClientMockRecorder{mock}
return mock
} | go | func NewMockNodeAPIClient(ctrl *gomock.Controller) *MockNodeAPIClient {
mock := &MockNodeAPIClient{ctrl: ctrl}
mock.recorder = &MockNodeAPIClientMockRecorder{mock}
return mock
} | [
"func",
"NewMockNodeAPIClient",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockNodeAPIClient",
"{",
"mock",
":=",
"&",
"MockNodeAPIClient",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockNodeAPIClientMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockNodeAPIClient creates a new mock instance | [
"NewMockNodeAPIClient",
"creates",
"a",
"new",
"mock",
"instance"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2107-L2111 |
7,216 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NodeRemove | func (m *MockNodeAPIClient) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error {
ret := m.ctrl.Call(m, "NodeRemove", ctx, nodeID, options)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockNodeAPIClient) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error {
ret := m.ctrl.Call(m, "NodeRemove", ctx, nodeID, options)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockNodeAPIClient",
")",
"NodeRemove",
"(",
"ctx",
"context",
".",
"Context",
",",
"nodeID",
"string",
",",
"options",
"types",
".",
"NodeRemoveOptions",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"nodeID",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // NodeRemove mocks base method | [
"NodeRemove",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2146-L2150 |
7,217 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NodeRemove | func (mr *MockNodeAPIClientMockRecorder) NodeRemove(ctx, nodeID, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRemove", reflect.TypeOf((*MockNodeAPIClient)(nil).NodeRemove), ctx, nodeID, options)
} | go | func (mr *MockNodeAPIClientMockRecorder) NodeRemove(ctx, nodeID, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeRemove", reflect.TypeOf((*MockNodeAPIClient)(nil).NodeRemove), ctx, nodeID, options)
} | [
"func",
"(",
"mr",
"*",
"MockNodeAPIClientMockRecorder",
")",
"NodeRemove",
"(",
"ctx",
",",
"nodeID",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockNodeAPIClient",
")",
"(",
"nil",
")",
".",
"NodeRemove",
")",
",",
"ctx",
",",
"nodeID",
",",
"options",
")",
"\n",
"}"
] | // NodeRemove indicates an expected call of NodeRemove | [
"NodeRemove",
"indicates",
"an",
"expected",
"call",
"of",
"NodeRemove"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2153-L2155 |
7,218 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NodeUpdate | func (m *MockNodeAPIClient) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error {
ret := m.ctrl.Call(m, "NodeUpdate", ctx, nodeID, version, node)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockNodeAPIClient) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error {
ret := m.ctrl.Call(m, "NodeUpdate", ctx, nodeID, version, node)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockNodeAPIClient",
")",
"NodeUpdate",
"(",
"ctx",
"context",
".",
"Context",
",",
"nodeID",
"string",
",",
"version",
"swarm",
".",
"Version",
",",
"node",
"swarm",
".",
"NodeSpec",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"nodeID",
",",
"version",
",",
"node",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // NodeUpdate mocks base method | [
"NodeUpdate",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2158-L2162 |
7,219 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NewMockPluginAPIClient | func NewMockPluginAPIClient(ctrl *gomock.Controller) *MockPluginAPIClient {
mock := &MockPluginAPIClient{ctrl: ctrl}
mock.recorder = &MockPluginAPIClientMockRecorder{mock}
return mock
} | go | func NewMockPluginAPIClient(ctrl *gomock.Controller) *MockPluginAPIClient {
mock := &MockPluginAPIClient{ctrl: ctrl}
mock.recorder = &MockPluginAPIClientMockRecorder{mock}
return mock
} | [
"func",
"NewMockPluginAPIClient",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockPluginAPIClient",
"{",
"mock",
":=",
"&",
"MockPluginAPIClient",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockPluginAPIClientMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockPluginAPIClient creates a new mock instance | [
"NewMockPluginAPIClient",
"creates",
"a",
"new",
"mock",
"instance"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2181-L2185 |
7,220 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginList | func (mr *MockPluginAPIClientMockRecorder) PluginList(ctx, filter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PluginList", reflect.TypeOf((*MockPluginAPIClient)(nil).PluginList), ctx, filter)
} | go | func (mr *MockPluginAPIClientMockRecorder) PluginList(ctx, filter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PluginList", reflect.TypeOf((*MockPluginAPIClient)(nil).PluginList), ctx, filter)
} | [
"func",
"(",
"mr",
"*",
"MockPluginAPIClientMockRecorder",
")",
"PluginList",
"(",
"ctx",
",",
"filter",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockPluginAPIClient",
")",
"(",
"nil",
")",
".",
"PluginList",
")",
",",
"ctx",
",",
"filter",
")",
"\n",
"}"
] | // PluginList indicates an expected call of PluginList | [
"PluginList",
"indicates",
"an",
"expected",
"call",
"of",
"PluginList"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2201-L2203 |
7,221 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginRemove | func (m *MockPluginAPIClient) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error {
ret := m.ctrl.Call(m, "PluginRemove", ctx, name, options)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockPluginAPIClient) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error {
ret := m.ctrl.Call(m, "PluginRemove", ctx, name, options)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockPluginAPIClient",
")",
"PluginRemove",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
",",
"options",
"types",
".",
"PluginRemoveOptions",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"name",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // PluginRemove mocks base method | [
"PluginRemove",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2206-L2210 |
7,222 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginRemove | func (mr *MockPluginAPIClientMockRecorder) PluginRemove(ctx, name, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PluginRemove", reflect.TypeOf((*MockPluginAPIClient)(nil).PluginRemove), ctx, name, options)
} | go | func (mr *MockPluginAPIClientMockRecorder) PluginRemove(ctx, name, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PluginRemove", reflect.TypeOf((*MockPluginAPIClient)(nil).PluginRemove), ctx, name, options)
} | [
"func",
"(",
"mr",
"*",
"MockPluginAPIClientMockRecorder",
")",
"PluginRemove",
"(",
"ctx",
",",
"name",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockPluginAPIClient",
")",
"(",
"nil",
")",
".",
"PluginRemove",
")",
",",
"ctx",
",",
"name",
",",
"options",
")",
"\n",
"}"
] | // PluginRemove indicates an expected call of PluginRemove | [
"PluginRemove",
"indicates",
"an",
"expected",
"call",
"of",
"PluginRemove"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2213-L2215 |
7,223 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginEnable | func (m *MockPluginAPIClient) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error {
ret := m.ctrl.Call(m, "PluginEnable", ctx, name, options)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockPluginAPIClient) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error {
ret := m.ctrl.Call(m, "PluginEnable", ctx, name, options)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockPluginAPIClient",
")",
"PluginEnable",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
",",
"options",
"types",
".",
"PluginEnableOptions",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"name",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // PluginEnable mocks base method | [
"PluginEnable",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2218-L2222 |
7,224 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginDisable | func (m *MockPluginAPIClient) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error {
ret := m.ctrl.Call(m, "PluginDisable", ctx, name, options)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockPluginAPIClient) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error {
ret := m.ctrl.Call(m, "PluginDisable", ctx, name, options)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockPluginAPIClient",
")",
"PluginDisable",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
",",
"options",
"types",
".",
"PluginDisableOptions",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"name",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // PluginDisable mocks base method | [
"PluginDisable",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2230-L2234 |
7,225 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginPush | func (m *MockPluginAPIClient) PluginPush(ctx context.Context, name, registryAuth string) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "PluginPush", ctx, name, registryAuth)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockPluginAPIClient) PluginPush(ctx context.Context, name, registryAuth string) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "PluginPush", ctx, name, registryAuth)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockPluginAPIClient",
")",
"PluginPush",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
",",
"registryAuth",
"string",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"name",
",",
"registryAuth",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"io",
".",
"ReadCloser",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // PluginPush mocks base method | [
"PluginPush",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2268-L2273 |
7,226 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginSet | func (m *MockPluginAPIClient) PluginSet(ctx context.Context, name string, args []string) error {
ret := m.ctrl.Call(m, "PluginSet", ctx, name, args)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockPluginAPIClient) PluginSet(ctx context.Context, name string, args []string) error {
ret := m.ctrl.Call(m, "PluginSet", ctx, name, args)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockPluginAPIClient",
")",
"PluginSet",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
",",
"args",
"[",
"]",
"string",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"name",
",",
"args",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // PluginSet mocks base method | [
"PluginSet",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2281-L2285 |
7,227 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginCreate | func (m *MockPluginAPIClient) PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error {
ret := m.ctrl.Call(m, "PluginCreate", ctx, createContext, options)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockPluginAPIClient) PluginCreate(ctx context.Context, createContext io.Reader, options types.PluginCreateOptions) error {
ret := m.ctrl.Call(m, "PluginCreate", ctx, createContext, options)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockPluginAPIClient",
")",
"PluginCreate",
"(",
"ctx",
"context",
".",
"Context",
",",
"createContext",
"io",
".",
"Reader",
",",
"options",
"types",
".",
"PluginCreateOptions",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"createContext",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // PluginCreate mocks base method | [
"PluginCreate",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2307-L2311 |
7,228 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | PluginCreate | func (mr *MockPluginAPIClientMockRecorder) PluginCreate(ctx, createContext, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PluginCreate", reflect.TypeOf((*MockPluginAPIClient)(nil).PluginCreate), ctx, createContext, options)
} | go | func (mr *MockPluginAPIClientMockRecorder) PluginCreate(ctx, createContext, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PluginCreate", reflect.TypeOf((*MockPluginAPIClient)(nil).PluginCreate), ctx, createContext, options)
} | [
"func",
"(",
"mr",
"*",
"MockPluginAPIClientMockRecorder",
")",
"PluginCreate",
"(",
"ctx",
",",
"createContext",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockPluginAPIClient",
")",
"(",
"nil",
")",
".",
"PluginCreate",
")",
",",
"ctx",
",",
"createContext",
",",
"options",
")",
"\n",
"}"
] | // PluginCreate indicates an expected call of PluginCreate | [
"PluginCreate",
"indicates",
"an",
"expected",
"call",
"of",
"PluginCreate"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2314-L2316 |
7,229 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NewMockServiceAPIClient | func NewMockServiceAPIClient(ctrl *gomock.Controller) *MockServiceAPIClient {
mock := &MockServiceAPIClient{ctrl: ctrl}
mock.recorder = &MockServiceAPIClientMockRecorder{mock}
return mock
} | go | func NewMockServiceAPIClient(ctrl *gomock.Controller) *MockServiceAPIClient {
mock := &MockServiceAPIClient{ctrl: ctrl}
mock.recorder = &MockServiceAPIClientMockRecorder{mock}
return mock
} | [
"func",
"NewMockServiceAPIClient",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockServiceAPIClient",
"{",
"mock",
":=",
"&",
"MockServiceAPIClient",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockServiceAPIClientMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockServiceAPIClient creates a new mock instance | [
"NewMockServiceAPIClient",
"creates",
"a",
"new",
"mock",
"instance"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2330-L2334 |
7,230 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ServiceCreate | func (m *MockServiceAPIClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) {
ret := m.ctrl.Call(m, "ServiceCreate", ctx, service, options)
ret0, _ := ret[0].(types.ServiceCreateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockServiceAPIClient) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) {
ret := m.ctrl.Call(m, "ServiceCreate", ctx, service, options)
ret0, _ := ret[0].(types.ServiceCreateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockServiceAPIClient",
")",
"ServiceCreate",
"(",
"ctx",
"context",
".",
"Context",
",",
"service",
"swarm",
".",
"ServiceSpec",
",",
"options",
"types",
".",
"ServiceCreateOptions",
")",
"(",
"types",
".",
"ServiceCreateResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"service",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"types",
".",
"ServiceCreateResponse",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ServiceCreate mocks base method | [
"ServiceCreate",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2342-L2347 |
7,231 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ServiceInspectWithRaw | func (m *MockServiceAPIClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) {
ret := m.ctrl.Call(m, "ServiceInspectWithRaw", ctx, serviceID, options)
ret0, _ := ret[0].(swarm.Service)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | func (m *MockServiceAPIClient) ServiceInspectWithRaw(ctx context.Context, serviceID string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) {
ret := m.ctrl.Call(m, "ServiceInspectWithRaw", ctx, serviceID, options)
ret0, _ := ret[0].(swarm.Service)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | [
"func",
"(",
"m",
"*",
"MockServiceAPIClient",
")",
"ServiceInspectWithRaw",
"(",
"ctx",
"context",
".",
"Context",
",",
"serviceID",
"string",
",",
"options",
"types",
".",
"ServiceInspectOptions",
")",
"(",
"swarm",
".",
"Service",
",",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"serviceID",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"swarm",
".",
"Service",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"[",
"]",
"byte",
")",
"\n",
"ret2",
",",
"_",
":=",
"ret",
"[",
"2",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
",",
"ret2",
"\n",
"}"
] | // ServiceInspectWithRaw mocks base method | [
"ServiceInspectWithRaw",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2355-L2361 |
7,232 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ServiceList | func (mr *MockServiceAPIClientMockRecorder) ServiceList(ctx, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceList", reflect.TypeOf((*MockServiceAPIClient)(nil).ServiceList), ctx, options)
} | go | func (mr *MockServiceAPIClientMockRecorder) ServiceList(ctx, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceList", reflect.TypeOf((*MockServiceAPIClient)(nil).ServiceList), ctx, options)
} | [
"func",
"(",
"mr",
"*",
"MockServiceAPIClientMockRecorder",
")",
"ServiceList",
"(",
"ctx",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockServiceAPIClient",
")",
"(",
"nil",
")",
".",
"ServiceList",
")",
",",
"ctx",
",",
"options",
")",
"\n",
"}"
] | // ServiceList indicates an expected call of ServiceList | [
"ServiceList",
"indicates",
"an",
"expected",
"call",
"of",
"ServiceList"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2377-L2379 |
7,233 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ServiceUpdate | func (m *MockServiceAPIClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) {
ret := m.ctrl.Call(m, "ServiceUpdate", ctx, serviceID, version, service, options)
ret0, _ := ret[0].(types.ServiceUpdateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockServiceAPIClient) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) (types.ServiceUpdateResponse, error) {
ret := m.ctrl.Call(m, "ServiceUpdate", ctx, serviceID, version, service, options)
ret0, _ := ret[0].(types.ServiceUpdateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockServiceAPIClient",
")",
"ServiceUpdate",
"(",
"ctx",
"context",
".",
"Context",
",",
"serviceID",
"string",
",",
"version",
"swarm",
".",
"Version",
",",
"service",
"swarm",
".",
"ServiceSpec",
",",
"options",
"types",
".",
"ServiceUpdateOptions",
")",
"(",
"types",
".",
"ServiceUpdateResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"serviceID",
",",
"version",
",",
"service",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"types",
".",
"ServiceUpdateResponse",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ServiceUpdate mocks base method | [
"ServiceUpdate",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2394-L2399 |
7,234 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | ServiceLogs | func (m *MockServiceAPIClient) ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "ServiceLogs", ctx, serviceID, options)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockServiceAPIClient) ServiceLogs(ctx context.Context, serviceID string, options types.ContainerLogsOptions) (io.ReadCloser, error) {
ret := m.ctrl.Call(m, "ServiceLogs", ctx, serviceID, options)
ret0, _ := ret[0].(io.ReadCloser)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockServiceAPIClient",
")",
"ServiceLogs",
"(",
"ctx",
"context",
".",
"Context",
",",
"serviceID",
"string",
",",
"options",
"types",
".",
"ContainerLogsOptions",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"serviceID",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"io",
".",
"ReadCloser",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // ServiceLogs mocks base method | [
"ServiceLogs",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2407-L2412 |
7,235 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | TaskList | func (m *MockServiceAPIClient) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) {
ret := m.ctrl.Call(m, "TaskList", ctx, options)
ret0, _ := ret[0].([]swarm.Task)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockServiceAPIClient) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) {
ret := m.ctrl.Call(m, "TaskList", ctx, options)
ret0, _ := ret[0].([]swarm.Task)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockServiceAPIClient",
")",
"TaskList",
"(",
"ctx",
"context",
".",
"Context",
",",
"options",
"types",
".",
"TaskListOptions",
")",
"(",
"[",
"]",
"swarm",
".",
"Task",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"[",
"]",
"swarm",
".",
"Task",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // TaskList mocks base method | [
"TaskList",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2447-L2452 |
7,236 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NewMockSwarmAPIClient | func NewMockSwarmAPIClient(ctrl *gomock.Controller) *MockSwarmAPIClient {
mock := &MockSwarmAPIClient{ctrl: ctrl}
mock.recorder = &MockSwarmAPIClientMockRecorder{mock}
return mock
} | go | func NewMockSwarmAPIClient(ctrl *gomock.Controller) *MockSwarmAPIClient {
mock := &MockSwarmAPIClient{ctrl: ctrl}
mock.recorder = &MockSwarmAPIClientMockRecorder{mock}
return mock
} | [
"func",
"NewMockSwarmAPIClient",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockSwarmAPIClient",
"{",
"mock",
":=",
"&",
"MockSwarmAPIClient",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockSwarmAPIClientMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockSwarmAPIClient creates a new mock instance | [
"NewMockSwarmAPIClient",
"creates",
"a",
"new",
"mock",
"instance"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2471-L2475 |
7,237 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SwarmInit | func (m *MockSwarmAPIClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) {
ret := m.ctrl.Call(m, "SwarmInit", ctx, req)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockSwarmAPIClient) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) {
ret := m.ctrl.Call(m, "SwarmInit", ctx, req)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockSwarmAPIClient",
")",
"SwarmInit",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"swarm",
".",
"InitRequest",
")",
"(",
"string",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"req",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"string",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // SwarmInit mocks base method | [
"SwarmInit",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2483-L2488 |
7,238 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SwarmInit | func (mr *MockSwarmAPIClientMockRecorder) SwarmInit(ctx, req interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SwarmInit", reflect.TypeOf((*MockSwarmAPIClient)(nil).SwarmInit), ctx, req)
} | go | func (mr *MockSwarmAPIClientMockRecorder) SwarmInit(ctx, req interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SwarmInit", reflect.TypeOf((*MockSwarmAPIClient)(nil).SwarmInit), ctx, req)
} | [
"func",
"(",
"mr",
"*",
"MockSwarmAPIClientMockRecorder",
")",
"SwarmInit",
"(",
"ctx",
",",
"req",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockSwarmAPIClient",
")",
"(",
"nil",
")",
".",
"SwarmInit",
")",
",",
"ctx",
",",
"req",
")",
"\n",
"}"
] | // SwarmInit indicates an expected call of SwarmInit | [
"SwarmInit",
"indicates",
"an",
"expected",
"call",
"of",
"SwarmInit"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2491-L2493 |
7,239 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SwarmLeave | func (m *MockSwarmAPIClient) SwarmLeave(ctx context.Context, force bool) error {
ret := m.ctrl.Call(m, "SwarmLeave", ctx, force)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockSwarmAPIClient) SwarmLeave(ctx context.Context, force bool) error {
ret := m.ctrl.Call(m, "SwarmLeave", ctx, force)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockSwarmAPIClient",
")",
"SwarmLeave",
"(",
"ctx",
"context",
".",
"Context",
",",
"force",
"bool",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"force",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // SwarmLeave mocks base method | [
"SwarmLeave",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2533-L2537 |
7,240 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NewMockSystemAPIClient | func NewMockSystemAPIClient(ctrl *gomock.Controller) *MockSystemAPIClient {
mock := &MockSystemAPIClient{ctrl: ctrl}
mock.recorder = &MockSystemAPIClientMockRecorder{mock}
return mock
} | go | func NewMockSystemAPIClient(ctrl *gomock.Controller) *MockSystemAPIClient {
mock := &MockSystemAPIClient{ctrl: ctrl}
mock.recorder = &MockSystemAPIClientMockRecorder{mock}
return mock
} | [
"func",
"NewMockSystemAPIClient",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockSystemAPIClient",
"{",
"mock",
":=",
"&",
"MockSystemAPIClient",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockSystemAPIClientMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockSystemAPIClient creates a new mock instance | [
"NewMockSystemAPIClient",
"creates",
"a",
"new",
"mock",
"instance"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2581-L2585 |
7,241 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | Events | func (mr *MockSystemAPIClientMockRecorder) Events(ctx, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Events", reflect.TypeOf((*MockSystemAPIClient)(nil).Events), ctx, options)
} | go | func (mr *MockSystemAPIClientMockRecorder) Events(ctx, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Events", reflect.TypeOf((*MockSystemAPIClient)(nil).Events), ctx, options)
} | [
"func",
"(",
"mr",
"*",
"MockSystemAPIClientMockRecorder",
")",
"Events",
"(",
"ctx",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockSystemAPIClient",
")",
"(",
"nil",
")",
".",
"Events",
")",
",",
"ctx",
",",
"options",
")",
"\n",
"}"
] | // Events indicates an expected call of Events | [
"Events",
"indicates",
"an",
"expected",
"call",
"of",
"Events"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2601-L2603 |
7,242 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NewMockVolumeAPIClient | func NewMockVolumeAPIClient(ctrl *gomock.Controller) *MockVolumeAPIClient {
mock := &MockVolumeAPIClient{ctrl: ctrl}
mock.recorder = &MockVolumeAPIClientMockRecorder{mock}
return mock
} | go | func NewMockVolumeAPIClient(ctrl *gomock.Controller) *MockVolumeAPIClient {
mock := &MockVolumeAPIClient{ctrl: ctrl}
mock.recorder = &MockVolumeAPIClientMockRecorder{mock}
return mock
} | [
"func",
"NewMockVolumeAPIClient",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockVolumeAPIClient",
"{",
"mock",
":=",
"&",
"MockVolumeAPIClient",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockVolumeAPIClientMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockVolumeAPIClient creates a new mock instance | [
"NewMockVolumeAPIClient",
"creates",
"a",
"new",
"mock",
"instance"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2669-L2673 |
7,243 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | VolumeCreate | func (mr *MockVolumeAPIClientMockRecorder) VolumeCreate(ctx, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeCreate", reflect.TypeOf((*MockVolumeAPIClient)(nil).VolumeCreate), ctx, options)
} | go | func (mr *MockVolumeAPIClientMockRecorder) VolumeCreate(ctx, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeCreate", reflect.TypeOf((*MockVolumeAPIClient)(nil).VolumeCreate), ctx, options)
} | [
"func",
"(",
"mr",
"*",
"MockVolumeAPIClientMockRecorder",
")",
"VolumeCreate",
"(",
"ctx",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockVolumeAPIClient",
")",
"(",
"nil",
")",
".",
"VolumeCreate",
")",
",",
"ctx",
",",
"options",
")",
"\n",
"}"
] | // VolumeCreate indicates an expected call of VolumeCreate | [
"VolumeCreate",
"indicates",
"an",
"expected",
"call",
"of",
"VolumeCreate"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2689-L2691 |
7,244 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | VolumeInspectWithRaw | func (m *MockVolumeAPIClient) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) {
ret := m.ctrl.Call(m, "VolumeInspectWithRaw", ctx, volumeID)
ret0, _ := ret[0].(types.Volume)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | func (m *MockVolumeAPIClient) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) {
ret := m.ctrl.Call(m, "VolumeInspectWithRaw", ctx, volumeID)
ret0, _ := ret[0].(types.Volume)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | [
"func",
"(",
"m",
"*",
"MockVolumeAPIClient",
")",
"VolumeInspectWithRaw",
"(",
"ctx",
"context",
".",
"Context",
",",
"volumeID",
"string",
")",
"(",
"types",
".",
"Volume",
",",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"volumeID",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"types",
".",
"Volume",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"[",
"]",
"byte",
")",
"\n",
"ret2",
",",
"_",
":=",
"ret",
"[",
"2",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
",",
"ret2",
"\n",
"}"
] | // VolumeInspectWithRaw mocks base method | [
"VolumeInspectWithRaw",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2707-L2713 |
7,245 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | VolumeInspectWithRaw | func (mr *MockVolumeAPIClientMockRecorder) VolumeInspectWithRaw(ctx, volumeID interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeInspectWithRaw", reflect.TypeOf((*MockVolumeAPIClient)(nil).VolumeInspectWithRaw), ctx, volumeID)
} | go | func (mr *MockVolumeAPIClientMockRecorder) VolumeInspectWithRaw(ctx, volumeID interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeInspectWithRaw", reflect.TypeOf((*MockVolumeAPIClient)(nil).VolumeInspectWithRaw), ctx, volumeID)
} | [
"func",
"(",
"mr",
"*",
"MockVolumeAPIClientMockRecorder",
")",
"VolumeInspectWithRaw",
"(",
"ctx",
",",
"volumeID",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockVolumeAPIClient",
")",
"(",
"nil",
")",
".",
"VolumeInspectWithRaw",
")",
",",
"ctx",
",",
"volumeID",
")",
"\n",
"}"
] | // VolumeInspectWithRaw indicates an expected call of VolumeInspectWithRaw | [
"VolumeInspectWithRaw",
"indicates",
"an",
"expected",
"call",
"of",
"VolumeInspectWithRaw"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2716-L2718 |
7,246 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | VolumeList | func (m *MockVolumeAPIClient) VolumeList(ctx context.Context, filter filters.Args) (volume.VolumesListOKBody, error) {
ret := m.ctrl.Call(m, "VolumeList", ctx, filter)
ret0, _ := ret[0].(volume.VolumesListOKBody)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockVolumeAPIClient) VolumeList(ctx context.Context, filter filters.Args) (volume.VolumesListOKBody, error) {
ret := m.ctrl.Call(m, "VolumeList", ctx, filter)
ret0, _ := ret[0].(volume.VolumesListOKBody)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockVolumeAPIClient",
")",
"VolumeList",
"(",
"ctx",
"context",
".",
"Context",
",",
"filter",
"filters",
".",
"Args",
")",
"(",
"volume",
".",
"VolumesListOKBody",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"filter",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"volume",
".",
"VolumesListOKBody",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // VolumeList mocks base method | [
"VolumeList",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2721-L2726 |
7,247 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | VolumeList | func (mr *MockVolumeAPIClientMockRecorder) VolumeList(ctx, filter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeList", reflect.TypeOf((*MockVolumeAPIClient)(nil).VolumeList), ctx, filter)
} | go | func (mr *MockVolumeAPIClientMockRecorder) VolumeList(ctx, filter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumeList", reflect.TypeOf((*MockVolumeAPIClient)(nil).VolumeList), ctx, filter)
} | [
"func",
"(",
"mr",
"*",
"MockVolumeAPIClientMockRecorder",
")",
"VolumeList",
"(",
"ctx",
",",
"filter",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockVolumeAPIClient",
")",
"(",
"nil",
")",
".",
"VolumeList",
")",
",",
"ctx",
",",
"filter",
")",
"\n",
"}"
] | // VolumeList indicates an expected call of VolumeList | [
"VolumeList",
"indicates",
"an",
"expected",
"call",
"of",
"VolumeList"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2729-L2731 |
7,248 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | VolumesPrune | func (mr *MockVolumeAPIClientMockRecorder) VolumesPrune(ctx, pruneFilter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumesPrune", reflect.TypeOf((*MockVolumeAPIClient)(nil).VolumesPrune), ctx, pruneFilter)
} | go | func (mr *MockVolumeAPIClientMockRecorder) VolumesPrune(ctx, pruneFilter interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VolumesPrune", reflect.TypeOf((*MockVolumeAPIClient)(nil).VolumesPrune), ctx, pruneFilter)
} | [
"func",
"(",
"mr",
"*",
"MockVolumeAPIClientMockRecorder",
")",
"VolumesPrune",
"(",
"ctx",
",",
"pruneFilter",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockVolumeAPIClient",
")",
"(",
"nil",
")",
".",
"VolumesPrune",
")",
",",
"ctx",
",",
"pruneFilter",
")",
"\n",
"}"
] | // VolumesPrune indicates an expected call of VolumesPrune | [
"VolumesPrune",
"indicates",
"an",
"expected",
"call",
"of",
"VolumesPrune"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2754-L2756 |
7,249 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | NewMockSecretAPIClient | func NewMockSecretAPIClient(ctrl *gomock.Controller) *MockSecretAPIClient {
mock := &MockSecretAPIClient{ctrl: ctrl}
mock.recorder = &MockSecretAPIClientMockRecorder{mock}
return mock
} | go | func NewMockSecretAPIClient(ctrl *gomock.Controller) *MockSecretAPIClient {
mock := &MockSecretAPIClient{ctrl: ctrl}
mock.recorder = &MockSecretAPIClientMockRecorder{mock}
return mock
} | [
"func",
"NewMockSecretAPIClient",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockSecretAPIClient",
"{",
"mock",
":=",
"&",
"MockSecretAPIClient",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockSecretAPIClientMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockSecretAPIClient creates a new mock instance | [
"NewMockSecretAPIClient",
"creates",
"a",
"new",
"mock",
"instance"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2770-L2774 |
7,250 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SecretList | func (m *MockSecretAPIClient) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {
ret := m.ctrl.Call(m, "SecretList", ctx, options)
ret0, _ := ret[0].([]swarm.Secret)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockSecretAPIClient) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) {
ret := m.ctrl.Call(m, "SecretList", ctx, options)
ret0, _ := ret[0].([]swarm.Secret)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockSecretAPIClient",
")",
"SecretList",
"(",
"ctx",
"context",
".",
"Context",
",",
"options",
"types",
".",
"SecretListOptions",
")",
"(",
"[",
"]",
"swarm",
".",
"Secret",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"options",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"[",
"]",
"swarm",
".",
"Secret",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // SecretList mocks base method | [
"SecretList",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2782-L2787 |
7,251 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SecretList | func (mr *MockSecretAPIClientMockRecorder) SecretList(ctx, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecretList", reflect.TypeOf((*MockSecretAPIClient)(nil).SecretList), ctx, options)
} | go | func (mr *MockSecretAPIClientMockRecorder) SecretList(ctx, options interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecretList", reflect.TypeOf((*MockSecretAPIClient)(nil).SecretList), ctx, options)
} | [
"func",
"(",
"mr",
"*",
"MockSecretAPIClientMockRecorder",
")",
"SecretList",
"(",
"ctx",
",",
"options",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockSecretAPIClient",
")",
"(",
"nil",
")",
".",
"SecretList",
")",
",",
"ctx",
",",
"options",
")",
"\n",
"}"
] | // SecretList indicates an expected call of SecretList | [
"SecretList",
"indicates",
"an",
"expected",
"call",
"of",
"SecretList"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2790-L2792 |
7,252 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SecretCreate | func (m *MockSecretAPIClient) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) {
ret := m.ctrl.Call(m, "SecretCreate", ctx, secret)
ret0, _ := ret[0].(types.SecretCreateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockSecretAPIClient) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) {
ret := m.ctrl.Call(m, "SecretCreate", ctx, secret)
ret0, _ := ret[0].(types.SecretCreateResponse)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockSecretAPIClient",
")",
"SecretCreate",
"(",
"ctx",
"context",
".",
"Context",
",",
"secret",
"swarm",
".",
"SecretSpec",
")",
"(",
"types",
".",
"SecretCreateResponse",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"secret",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"types",
".",
"SecretCreateResponse",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
"\n",
"}"
] | // SecretCreate mocks base method | [
"SecretCreate",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2795-L2800 |
7,253 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SecretCreate | func (mr *MockSecretAPIClientMockRecorder) SecretCreate(ctx, secret interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecretCreate", reflect.TypeOf((*MockSecretAPIClient)(nil).SecretCreate), ctx, secret)
} | go | func (mr *MockSecretAPIClientMockRecorder) SecretCreate(ctx, secret interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecretCreate", reflect.TypeOf((*MockSecretAPIClient)(nil).SecretCreate), ctx, secret)
} | [
"func",
"(",
"mr",
"*",
"MockSecretAPIClientMockRecorder",
")",
"SecretCreate",
"(",
"ctx",
",",
"secret",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockSecretAPIClient",
")",
"(",
"nil",
")",
".",
"SecretCreate",
")",
",",
"ctx",
",",
"secret",
")",
"\n",
"}"
] | // SecretCreate indicates an expected call of SecretCreate | [
"SecretCreate",
"indicates",
"an",
"expected",
"call",
"of",
"SecretCreate"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2803-L2805 |
7,254 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SecretRemove | func (mr *MockSecretAPIClientMockRecorder) SecretRemove(ctx, id interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecretRemove", reflect.TypeOf((*MockSecretAPIClient)(nil).SecretRemove), ctx, id)
} | go | func (mr *MockSecretAPIClientMockRecorder) SecretRemove(ctx, id interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecretRemove", reflect.TypeOf((*MockSecretAPIClient)(nil).SecretRemove), ctx, id)
} | [
"func",
"(",
"mr",
"*",
"MockSecretAPIClientMockRecorder",
")",
"SecretRemove",
"(",
"ctx",
",",
"id",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockSecretAPIClient",
")",
"(",
"nil",
")",
".",
"SecretRemove",
")",
",",
"ctx",
",",
"id",
")",
"\n",
"}"
] | // SecretRemove indicates an expected call of SecretRemove | [
"SecretRemove",
"indicates",
"an",
"expected",
"call",
"of",
"SecretRemove"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2815-L2817 |
7,255 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SecretInspectWithRaw | func (m *MockSecretAPIClient) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) {
ret := m.ctrl.Call(m, "SecretInspectWithRaw", ctx, name)
ret0, _ := ret[0].(swarm.Secret)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | go | func (m *MockSecretAPIClient) SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) {
ret := m.ctrl.Call(m, "SecretInspectWithRaw", ctx, name)
ret0, _ := ret[0].(swarm.Secret)
ret1, _ := ret[1].([]byte)
ret2, _ := ret[2].(error)
return ret0, ret1, ret2
} | [
"func",
"(",
"m",
"*",
"MockSecretAPIClient",
")",
"SecretInspectWithRaw",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
")",
"(",
"swarm",
".",
"Secret",
",",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"name",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"swarm",
".",
"Secret",
")",
"\n",
"ret1",
",",
"_",
":=",
"ret",
"[",
"1",
"]",
".",
"(",
"[",
"]",
"byte",
")",
"\n",
"ret2",
",",
"_",
":=",
"ret",
"[",
"2",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
",",
"ret1",
",",
"ret2",
"\n",
"}"
] | // SecretInspectWithRaw mocks base method | [
"SecretInspectWithRaw",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2820-L2826 |
7,256 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SecretInspectWithRaw | func (mr *MockSecretAPIClientMockRecorder) SecretInspectWithRaw(ctx, name interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecretInspectWithRaw", reflect.TypeOf((*MockSecretAPIClient)(nil).SecretInspectWithRaw), ctx, name)
} | go | func (mr *MockSecretAPIClientMockRecorder) SecretInspectWithRaw(ctx, name interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SecretInspectWithRaw", reflect.TypeOf((*MockSecretAPIClient)(nil).SecretInspectWithRaw), ctx, name)
} | [
"func",
"(",
"mr",
"*",
"MockSecretAPIClientMockRecorder",
")",
"SecretInspectWithRaw",
"(",
"ctx",
",",
"name",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockSecretAPIClient",
")",
"(",
"nil",
")",
".",
"SecretInspectWithRaw",
")",
",",
"ctx",
",",
"name",
")",
"\n",
"}"
] | // SecretInspectWithRaw indicates an expected call of SecretInspectWithRaw | [
"SecretInspectWithRaw",
"indicates",
"an",
"expected",
"call",
"of",
"SecretInspectWithRaw"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2829-L2831 |
7,257 | aporeto-inc/trireme-lib | monitor/internal/docker/mockdocker/mockdocker.go | SecretUpdate | func (m *MockSecretAPIClient) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error {
ret := m.ctrl.Call(m, "SecretUpdate", ctx, id, version, secret)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockSecretAPIClient) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error {
ret := m.ctrl.Call(m, "SecretUpdate", ctx, id, version, secret)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockSecretAPIClient",
")",
"SecretUpdate",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"string",
",",
"version",
"swarm",
".",
"Version",
",",
"secret",
"swarm",
".",
"SecretSpec",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"ctx",
",",
"id",
",",
"version",
",",
"secret",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // SecretUpdate mocks base method | [
"SecretUpdate",
"mocks",
"base",
"method"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/docker/mockdocker/mockdocker.go#L2834-L2838 |
7,258 | aporeto-inc/trireme-lib | controller/internal/processmon/processmon.go | New | func New(ctx context.Context, p *env.RemoteParameters, c chan *policy.RuntimeError, r rpcwrapper.RPCClient) ProcessManager {
m := &RemoteMonitor{
remoteEnforcerTempBuildPath: remoteEnforcerTempBuildPath,
remoteEnforcerBuildName: remoteEnforcerBuildName,
netNSPath: netNSPath,
activeProcesses: cache.NewCache(processMonitorCacheName),
childExitStatus: make(chan exitStatus, 100),
logToConsole: p.LogToConsole,
logWithID: p.LogWithID,
logLevel: p.LogLevel,
logFormat: p.LogFormat,
compressedTags: p.CompressedTags,
runtimeErrorChannel: c,
rpc: r,
}
go m.collectChildExitStatus(ctx)
return m
} | go | func New(ctx context.Context, p *env.RemoteParameters, c chan *policy.RuntimeError, r rpcwrapper.RPCClient) ProcessManager {
m := &RemoteMonitor{
remoteEnforcerTempBuildPath: remoteEnforcerTempBuildPath,
remoteEnforcerBuildName: remoteEnforcerBuildName,
netNSPath: netNSPath,
activeProcesses: cache.NewCache(processMonitorCacheName),
childExitStatus: make(chan exitStatus, 100),
logToConsole: p.LogToConsole,
logWithID: p.LogWithID,
logLevel: p.LogLevel,
logFormat: p.LogFormat,
compressedTags: p.CompressedTags,
runtimeErrorChannel: c,
rpc: r,
}
go m.collectChildExitStatus(ctx)
return m
} | [
"func",
"New",
"(",
"ctx",
"context",
".",
"Context",
",",
"p",
"*",
"env",
".",
"RemoteParameters",
",",
"c",
"chan",
"*",
"policy",
".",
"RuntimeError",
",",
"r",
"rpcwrapper",
".",
"RPCClient",
")",
"ProcessManager",
"{",
"m",
":=",
"&",
"RemoteMonitor",
"{",
"remoteEnforcerTempBuildPath",
":",
"remoteEnforcerTempBuildPath",
",",
"remoteEnforcerBuildName",
":",
"remoteEnforcerBuildName",
",",
"netNSPath",
":",
"netNSPath",
",",
"activeProcesses",
":",
"cache",
".",
"NewCache",
"(",
"processMonitorCacheName",
")",
",",
"childExitStatus",
":",
"make",
"(",
"chan",
"exitStatus",
",",
"100",
")",
",",
"logToConsole",
":",
"p",
".",
"LogToConsole",
",",
"logWithID",
":",
"p",
".",
"LogWithID",
",",
"logLevel",
":",
"p",
".",
"LogLevel",
",",
"logFormat",
":",
"p",
".",
"LogFormat",
",",
"compressedTags",
":",
"p",
".",
"CompressedTags",
",",
"runtimeErrorChannel",
":",
"c",
",",
"rpc",
":",
"r",
",",
"}",
"\n\n",
"go",
"m",
".",
"collectChildExitStatus",
"(",
"ctx",
")",
"\n\n",
"return",
"m",
"\n",
"}"
] | // New is a method to create a new remote process monitor. | [
"New",
"is",
"a",
"method",
"to",
"create",
"a",
"new",
"remote",
"process",
"monitor",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/internal/processmon/processmon.go#L90-L110 |
7,259 | aporeto-inc/trireme-lib | controller/internal/processmon/processmon.go | KillRemoteEnforcer | func (p *RemoteMonitor) KillRemoteEnforcer(contextID string, force bool) error {
p.Lock()
s, err := p.activeProcesses.Get(contextID)
if err != nil {
p.Unlock()
return fmt.Errorf("unable to find process for context: %s", contextID)
}
p.activeProcesses.Remove(contextID) // nolint errcheck
p.Unlock()
procInfo, ok := s.(*processInfo)
if !ok {
return fmt.Errorf("internal error - invalid type for process")
}
procInfo.Lock()
defer procInfo.Unlock()
if procInfo.process == nil {
return fmt.Errorf("cannot find process for context: %s", contextID)
}
req := &rpcwrapper.Request{
Payload: procInfo.process.Pid,
}
resp := &rpcwrapper.Response{}
c := make(chan error, 1)
go func() {
c <- p.rpc.RemoteCall(contextID, remoteenforcer.EnforcerExit, req, resp)
}()
select {
case err := <-c:
if err != nil && force {
zap.L().Error("Failed to stop gracefully - forcing kill",
zap.Error(err))
procInfo.process.Kill() // nolint
}
case <-time.After(5 * time.Second):
if force {
zap.L().Error("Time out on terminating remote enforcer - forcing kill")
procInfo.process.Kill() // nolint
}
}
p.rpc.DestroyRPCClient(contextID)
return nil
} | go | func (p *RemoteMonitor) KillRemoteEnforcer(contextID string, force bool) error {
p.Lock()
s, err := p.activeProcesses.Get(contextID)
if err != nil {
p.Unlock()
return fmt.Errorf("unable to find process for context: %s", contextID)
}
p.activeProcesses.Remove(contextID) // nolint errcheck
p.Unlock()
procInfo, ok := s.(*processInfo)
if !ok {
return fmt.Errorf("internal error - invalid type for process")
}
procInfo.Lock()
defer procInfo.Unlock()
if procInfo.process == nil {
return fmt.Errorf("cannot find process for context: %s", contextID)
}
req := &rpcwrapper.Request{
Payload: procInfo.process.Pid,
}
resp := &rpcwrapper.Response{}
c := make(chan error, 1)
go func() {
c <- p.rpc.RemoteCall(contextID, remoteenforcer.EnforcerExit, req, resp)
}()
select {
case err := <-c:
if err != nil && force {
zap.L().Error("Failed to stop gracefully - forcing kill",
zap.Error(err))
procInfo.process.Kill() // nolint
}
case <-time.After(5 * time.Second):
if force {
zap.L().Error("Time out on terminating remote enforcer - forcing kill")
procInfo.process.Kill() // nolint
}
}
p.rpc.DestroyRPCClient(contextID)
return nil
} | [
"func",
"(",
"p",
"*",
"RemoteMonitor",
")",
"KillRemoteEnforcer",
"(",
"contextID",
"string",
",",
"force",
"bool",
")",
"error",
"{",
"p",
".",
"Lock",
"(",
")",
"\n",
"s",
",",
"err",
":=",
"p",
".",
"activeProcesses",
".",
"Get",
"(",
"contextID",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"p",
".",
"Unlock",
"(",
")",
"\n",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"contextID",
")",
"\n",
"}",
"\n\n",
"p",
".",
"activeProcesses",
".",
"Remove",
"(",
"contextID",
")",
"// nolint errcheck",
"\n",
"p",
".",
"Unlock",
"(",
")",
"\n\n",
"procInfo",
",",
"ok",
":=",
"s",
".",
"(",
"*",
"processInfo",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"procInfo",
".",
"Lock",
"(",
")",
"\n",
"defer",
"procInfo",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"procInfo",
".",
"process",
"==",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"contextID",
")",
"\n",
"}",
"\n\n",
"req",
":=",
"&",
"rpcwrapper",
".",
"Request",
"{",
"Payload",
":",
"procInfo",
".",
"process",
".",
"Pid",
",",
"}",
"\n",
"resp",
":=",
"&",
"rpcwrapper",
".",
"Response",
"{",
"}",
"\n\n",
"c",
":=",
"make",
"(",
"chan",
"error",
",",
"1",
")",
"\n",
"go",
"func",
"(",
")",
"{",
"c",
"<-",
"p",
".",
"rpc",
".",
"RemoteCall",
"(",
"contextID",
",",
"remoteenforcer",
".",
"EnforcerExit",
",",
"req",
",",
"resp",
")",
"\n",
"}",
"(",
")",
"\n\n",
"select",
"{",
"case",
"err",
":=",
"<-",
"c",
":",
"if",
"err",
"!=",
"nil",
"&&",
"force",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Error",
"(",
"\"",
"\"",
",",
"zap",
".",
"Error",
"(",
"err",
")",
")",
"\n",
"procInfo",
".",
"process",
".",
"Kill",
"(",
")",
"// nolint",
"\n",
"}",
"\n",
"case",
"<-",
"time",
".",
"After",
"(",
"5",
"*",
"time",
".",
"Second",
")",
":",
"if",
"force",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Error",
"(",
"\"",
"\"",
")",
"\n",
"procInfo",
".",
"process",
".",
"Kill",
"(",
")",
"// nolint",
"\n",
"}",
"\n",
"}",
"\n\n",
"p",
".",
"rpc",
".",
"DestroyRPCClient",
"(",
"contextID",
")",
"\n\n",
"return",
"nil",
"\n",
"}"
] | // KillRemoteEnforcer sends a rpc to the process to exit failing which it will kill the process | [
"KillRemoteEnforcer",
"sends",
"a",
"rpc",
"to",
"the",
"process",
"to",
"exit",
"failing",
"which",
"it",
"will",
"kill",
"the",
"process"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/internal/processmon/processmon.go#L245-L296 |
7,260 | aporeto-inc/trireme-lib | controller/internal/processmon/processmon.go | collectChildExitStatus | func (p *RemoteMonitor) collectChildExitStatus(ctx context.Context) {
defer func() {
if r := recover(); r != nil {
zap.L().Error("Policy engine has possibly closed the channel")
return
}
}()
for {
select {
case <-ctx.Done():
return
case es := <-p.childExitStatus:
if err := p.activeProcesses.Remove(es.contextID); err != nil {
continue
}
p.rpc.DestroyRPCClient(es.contextID)
if p.runtimeErrorChannel != nil {
if es.exitStatus != nil {
zap.L().Error("Remote enforcer exited with an error",
zap.String("nativeContextID", es.contextID),
zap.Int("pid", es.process),
zap.Error(es.exitStatus),
)
} else {
zap.L().Warn("Remote enforcer exited",
zap.String("nativeContextID", es.contextID),
zap.Int("pid", es.process),
)
}
p.runtimeErrorChannel <- &policy.RuntimeError{
ContextID: es.contextID,
Error: fmt.Errorf("remote enforcer terminated: %s", es.exitStatus),
}
}
}
}
} | go | func (p *RemoteMonitor) collectChildExitStatus(ctx context.Context) {
defer func() {
if r := recover(); r != nil {
zap.L().Error("Policy engine has possibly closed the channel")
return
}
}()
for {
select {
case <-ctx.Done():
return
case es := <-p.childExitStatus:
if err := p.activeProcesses.Remove(es.contextID); err != nil {
continue
}
p.rpc.DestroyRPCClient(es.contextID)
if p.runtimeErrorChannel != nil {
if es.exitStatus != nil {
zap.L().Error("Remote enforcer exited with an error",
zap.String("nativeContextID", es.contextID),
zap.Int("pid", es.process),
zap.Error(es.exitStatus),
)
} else {
zap.L().Warn("Remote enforcer exited",
zap.String("nativeContextID", es.contextID),
zap.Int("pid", es.process),
)
}
p.runtimeErrorChannel <- &policy.RuntimeError{
ContextID: es.contextID,
Error: fmt.Errorf("remote enforcer terminated: %s", es.exitStatus),
}
}
}
}
} | [
"func",
"(",
"p",
"*",
"RemoteMonitor",
")",
"collectChildExitStatus",
"(",
"ctx",
"context",
".",
"Context",
")",
"{",
"defer",
"func",
"(",
")",
"{",
"if",
"r",
":=",
"recover",
"(",
")",
";",
"r",
"!=",
"nil",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Error",
"(",
"\"",
"\"",
")",
"\n",
"return",
"\n",
"}",
"\n",
"}",
"(",
")",
"\n\n",
"for",
"{",
"select",
"{",
"case",
"<-",
"ctx",
".",
"Done",
"(",
")",
":",
"return",
"\n\n",
"case",
"es",
":=",
"<-",
"p",
".",
"childExitStatus",
":",
"if",
"err",
":=",
"p",
".",
"activeProcesses",
".",
"Remove",
"(",
"es",
".",
"contextID",
")",
";",
"err",
"!=",
"nil",
"{",
"continue",
"\n",
"}",
"\n\n",
"p",
".",
"rpc",
".",
"DestroyRPCClient",
"(",
"es",
".",
"contextID",
")",
"\n\n",
"if",
"p",
".",
"runtimeErrorChannel",
"!=",
"nil",
"{",
"if",
"es",
".",
"exitStatus",
"!=",
"nil",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Error",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"es",
".",
"contextID",
")",
",",
"zap",
".",
"Int",
"(",
"\"",
"\"",
",",
"es",
".",
"process",
")",
",",
"zap",
".",
"Error",
"(",
"es",
".",
"exitStatus",
")",
",",
")",
"\n",
"}",
"else",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Warn",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"es",
".",
"contextID",
")",
",",
"zap",
".",
"Int",
"(",
"\"",
"\"",
",",
"es",
".",
"process",
")",
",",
")",
"\n",
"}",
"\n",
"p",
".",
"runtimeErrorChannel",
"<-",
"&",
"policy",
".",
"RuntimeError",
"{",
"ContextID",
":",
"es",
".",
"contextID",
",",
"Error",
":",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"es",
".",
"exitStatus",
")",
",",
"}",
"\n",
"}",
"\n\n",
"}",
"\n",
"}",
"\n",
"}"
] | // collectChildExitStatus is an async function which collects status for all launched child processes | [
"collectChildExitStatus",
"is",
"an",
"async",
"function",
"which",
"collects",
"status",
"for",
"all",
"launched",
"child",
"processes"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/internal/processmon/processmon.go#L299-L342 |
7,261 | aporeto-inc/trireme-lib | controller/internal/processmon/processmon.go | pollStdOutAndErr | func (p *RemoteMonitor) pollStdOutAndErr(
cmd *exec.Cmd,
contextID string,
) (err error) {
stdout, err := cmd.StdoutPipe()
if err != nil {
return err
}
stderr, err := cmd.StderrPipe()
if err != nil {
return err
}
// Stdout/err processing
go processIOReader(stdout, contextID)
go processIOReader(stderr, contextID)
return nil
} | go | func (p *RemoteMonitor) pollStdOutAndErr(
cmd *exec.Cmd,
contextID string,
) (err error) {
stdout, err := cmd.StdoutPipe()
if err != nil {
return err
}
stderr, err := cmd.StderrPipe()
if err != nil {
return err
}
// Stdout/err processing
go processIOReader(stdout, contextID)
go processIOReader(stderr, contextID)
return nil
} | [
"func",
"(",
"p",
"*",
"RemoteMonitor",
")",
"pollStdOutAndErr",
"(",
"cmd",
"*",
"exec",
".",
"Cmd",
",",
"contextID",
"string",
",",
")",
"(",
"err",
"error",
")",
"{",
"stdout",
",",
"err",
":=",
"cmd",
".",
"StdoutPipe",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"stderr",
",",
"err",
":=",
"cmd",
".",
"StderrPipe",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Stdout/err processing",
"go",
"processIOReader",
"(",
"stdout",
",",
"contextID",
")",
"\n",
"go",
"processIOReader",
"(",
"stderr",
",",
"contextID",
")",
"\n\n",
"return",
"nil",
"\n",
"}"
] | // pollStdOutAndErr polls std out and err | [
"pollStdOutAndErr",
"polls",
"std",
"out",
"and",
"err"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/internal/processmon/processmon.go#L345-L365 |
7,262 | aporeto-inc/trireme-lib | controller/internal/processmon/processmon.go | getLaunchProcessCmd | func (p *RemoteMonitor) getLaunchProcessCmd(remoteEnforcerBuildPath, remoteEnforcerName, arg string) *exec.Cmd {
cmdName := filepath.Join(remoteEnforcerBuildPath, remoteEnforcerName)
cmdArgs := []string{arg}
zap.L().Debug("Enforcer executed",
zap.String("command", cmdName),
zap.Strings("args", cmdArgs),
)
return execCommand(cmdName, cmdArgs...)
} | go | func (p *RemoteMonitor) getLaunchProcessCmd(remoteEnforcerBuildPath, remoteEnforcerName, arg string) *exec.Cmd {
cmdName := filepath.Join(remoteEnforcerBuildPath, remoteEnforcerName)
cmdArgs := []string{arg}
zap.L().Debug("Enforcer executed",
zap.String("command", cmdName),
zap.Strings("args", cmdArgs),
)
return execCommand(cmdName, cmdArgs...)
} | [
"func",
"(",
"p",
"*",
"RemoteMonitor",
")",
"getLaunchProcessCmd",
"(",
"remoteEnforcerBuildPath",
",",
"remoteEnforcerName",
",",
"arg",
"string",
")",
"*",
"exec",
".",
"Cmd",
"{",
"cmdName",
":=",
"filepath",
".",
"Join",
"(",
"remoteEnforcerBuildPath",
",",
"remoteEnforcerName",
")",
"\n\n",
"cmdArgs",
":=",
"[",
"]",
"string",
"{",
"arg",
"}",
"\n",
"zap",
".",
"L",
"(",
")",
".",
"Debug",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"cmdName",
")",
",",
"zap",
".",
"Strings",
"(",
"\"",
"\"",
",",
"cmdArgs",
")",
",",
")",
"\n\n",
"return",
"execCommand",
"(",
"cmdName",
",",
"cmdArgs",
"...",
")",
"\n",
"}"
] | // getLaunchProcessCmd returns the command used to launch the enforcerd | [
"getLaunchProcessCmd",
"returns",
"the",
"command",
"used",
"to",
"launch",
"the",
"enforcerd"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/internal/processmon/processmon.go#L368-L379 |
7,263 | aporeto-inc/trireme-lib | controller/internal/processmon/processmon.go | getLaunchProcessEnvVars | func (p *RemoteMonitor) getLaunchProcessEnvVars(
procMountPoint string,
contextID string,
randomkeystring string,
statsServerSecret string,
refPid int,
refNSPath string,
) []string {
newEnvVars := []string{
constants.EnvMountPoint + "=" + procMountPoint,
constants.EnvContextSocket + "=" + contextID2SocketPath(contextID),
constants.EnvStatsChannel + "=" + constants.StatsChannel,
constants.EnvDebugChannel + "=" + constants.DebugChannel,
constants.EnvRPCClientSecret + "=" + randomkeystring,
constants.EnvStatsSecret + "=" + statsServerSecret,
constants.EnvContainerPID + "=" + strconv.Itoa(refPid),
constants.EnvLogLevel + "=" + p.logLevel,
constants.EnvLogFormat + "=" + p.logFormat,
}
if p.compressedTags != claimsheader.CompressionTypeNone {
newEnvVars = append(newEnvVars, constants.EnvCompressedTags+"="+string(p.compressedTags))
}
if p.logToConsole {
newEnvVars = append(newEnvVars, constants.EnvLogToConsole+"="+constants.EnvLogToConsoleEnable)
}
if p.logWithID {
newEnvVars = append(newEnvVars, constants.EnvLogID+"="+contextID)
}
// If the PURuntime Specified a NSPath, then it is added as a new env var also.
if refNSPath != "" {
newEnvVars = append(newEnvVars, constants.EnvNSPath+"="+refNSPath)
}
return newEnvVars
} | go | func (p *RemoteMonitor) getLaunchProcessEnvVars(
procMountPoint string,
contextID string,
randomkeystring string,
statsServerSecret string,
refPid int,
refNSPath string,
) []string {
newEnvVars := []string{
constants.EnvMountPoint + "=" + procMountPoint,
constants.EnvContextSocket + "=" + contextID2SocketPath(contextID),
constants.EnvStatsChannel + "=" + constants.StatsChannel,
constants.EnvDebugChannel + "=" + constants.DebugChannel,
constants.EnvRPCClientSecret + "=" + randomkeystring,
constants.EnvStatsSecret + "=" + statsServerSecret,
constants.EnvContainerPID + "=" + strconv.Itoa(refPid),
constants.EnvLogLevel + "=" + p.logLevel,
constants.EnvLogFormat + "=" + p.logFormat,
}
if p.compressedTags != claimsheader.CompressionTypeNone {
newEnvVars = append(newEnvVars, constants.EnvCompressedTags+"="+string(p.compressedTags))
}
if p.logToConsole {
newEnvVars = append(newEnvVars, constants.EnvLogToConsole+"="+constants.EnvLogToConsoleEnable)
}
if p.logWithID {
newEnvVars = append(newEnvVars, constants.EnvLogID+"="+contextID)
}
// If the PURuntime Specified a NSPath, then it is added as a new env var also.
if refNSPath != "" {
newEnvVars = append(newEnvVars, constants.EnvNSPath+"="+refNSPath)
}
return newEnvVars
} | [
"func",
"(",
"p",
"*",
"RemoteMonitor",
")",
"getLaunchProcessEnvVars",
"(",
"procMountPoint",
"string",
",",
"contextID",
"string",
",",
"randomkeystring",
"string",
",",
"statsServerSecret",
"string",
",",
"refPid",
"int",
",",
"refNSPath",
"string",
",",
")",
"[",
"]",
"string",
"{",
"newEnvVars",
":=",
"[",
"]",
"string",
"{",
"constants",
".",
"EnvMountPoint",
"+",
"\"",
"\"",
"+",
"procMountPoint",
",",
"constants",
".",
"EnvContextSocket",
"+",
"\"",
"\"",
"+",
"contextID2SocketPath",
"(",
"contextID",
")",
",",
"constants",
".",
"EnvStatsChannel",
"+",
"\"",
"\"",
"+",
"constants",
".",
"StatsChannel",
",",
"constants",
".",
"EnvDebugChannel",
"+",
"\"",
"\"",
"+",
"constants",
".",
"DebugChannel",
",",
"constants",
".",
"EnvRPCClientSecret",
"+",
"\"",
"\"",
"+",
"randomkeystring",
",",
"constants",
".",
"EnvStatsSecret",
"+",
"\"",
"\"",
"+",
"statsServerSecret",
",",
"constants",
".",
"EnvContainerPID",
"+",
"\"",
"\"",
"+",
"strconv",
".",
"Itoa",
"(",
"refPid",
")",
",",
"constants",
".",
"EnvLogLevel",
"+",
"\"",
"\"",
"+",
"p",
".",
"logLevel",
",",
"constants",
".",
"EnvLogFormat",
"+",
"\"",
"\"",
"+",
"p",
".",
"logFormat",
",",
"}",
"\n\n",
"if",
"p",
".",
"compressedTags",
"!=",
"claimsheader",
".",
"CompressionTypeNone",
"{",
"newEnvVars",
"=",
"append",
"(",
"newEnvVars",
",",
"constants",
".",
"EnvCompressedTags",
"+",
"\"",
"\"",
"+",
"string",
"(",
"p",
".",
"compressedTags",
")",
")",
"\n",
"}",
"\n\n",
"if",
"p",
".",
"logToConsole",
"{",
"newEnvVars",
"=",
"append",
"(",
"newEnvVars",
",",
"constants",
".",
"EnvLogToConsole",
"+",
"\"",
"\"",
"+",
"constants",
".",
"EnvLogToConsoleEnable",
")",
"\n",
"}",
"\n\n",
"if",
"p",
".",
"logWithID",
"{",
"newEnvVars",
"=",
"append",
"(",
"newEnvVars",
",",
"constants",
".",
"EnvLogID",
"+",
"\"",
"\"",
"+",
"contextID",
")",
"\n",
"}",
"\n\n",
"// If the PURuntime Specified a NSPath, then it is added as a new env var also.",
"if",
"refNSPath",
"!=",
"\"",
"\"",
"{",
"newEnvVars",
"=",
"append",
"(",
"newEnvVars",
",",
"constants",
".",
"EnvNSPath",
"+",
"\"",
"\"",
"+",
"refNSPath",
")",
"\n",
"}",
"\n\n",
"return",
"newEnvVars",
"\n",
"}"
] | // getLaunchProcessEnvVars returns a slice of env variable strings where each string is in the form of key=value | [
"getLaunchProcessEnvVars",
"returns",
"a",
"slice",
"of",
"env",
"variable",
"strings",
"where",
"each",
"string",
"is",
"in",
"the",
"form",
"of",
"key",
"=",
"value"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/internal/processmon/processmon.go#L382-L421 |
7,264 | aporeto-inc/trireme-lib | controller/internal/processmon/processmon.go | contextID2SocketPath | func contextID2SocketPath(contextID string) string {
if contextID == "" {
panic("contextID is empty")
}
return filepath.Join("/var/run/", strings.Replace(contextID, "/", "_", -1)+".sock")
} | go | func contextID2SocketPath(contextID string) string {
if contextID == "" {
panic("contextID is empty")
}
return filepath.Join("/var/run/", strings.Replace(contextID, "/", "_", -1)+".sock")
} | [
"func",
"contextID2SocketPath",
"(",
"contextID",
"string",
")",
"string",
"{",
"if",
"contextID",
"==",
"\"",
"\"",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"filepath",
".",
"Join",
"(",
"\"",
"\"",
",",
"strings",
".",
"Replace",
"(",
"contextID",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"-",
"1",
")",
"+",
"\"",
"\"",
")",
"\n",
"}"
] | // contextID2SocketPath returns the socket path to use for a givent context | [
"contextID2SocketPath",
"returns",
"the",
"socket",
"path",
"to",
"use",
"for",
"a",
"givent",
"context"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/internal/processmon/processmon.go#L424-L431 |
7,265 | aporeto-inc/trireme-lib | controller/internal/processmon/processmon.go | processIOReader | func processIOReader(fd io.Reader, contextID string) {
reader := bufio.NewReader(fd)
for {
str, err := reader.ReadString('\n')
if err != nil {
return
}
fmt.Print("[" + contextID + "]:" + str)
}
} | go | func processIOReader(fd io.Reader, contextID string) {
reader := bufio.NewReader(fd)
for {
str, err := reader.ReadString('\n')
if err != nil {
return
}
fmt.Print("[" + contextID + "]:" + str)
}
} | [
"func",
"processIOReader",
"(",
"fd",
"io",
".",
"Reader",
",",
"contextID",
"string",
")",
"{",
"reader",
":=",
"bufio",
".",
"NewReader",
"(",
"fd",
")",
"\n",
"for",
"{",
"str",
",",
"err",
":=",
"reader",
".",
"ReadString",
"(",
"'\\n'",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"fmt",
".",
"Print",
"(",
"\"",
"\"",
"+",
"contextID",
"+",
"\"",
"\"",
"+",
"str",
")",
"\n",
"}",
"\n",
"}"
] | // processIOReader will read from a reader and print it on the calling process | [
"processIOReader",
"will",
"read",
"from",
"a",
"reader",
"and",
"print",
"it",
"on",
"the",
"calling",
"process"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/internal/processmon/processmon.go#L434-L443 |
7,266 | aporeto-inc/trireme-lib | utils/allocator/allocator.go | New | func New(start, size int) Allocator {
a := &allocator{
allocate: make(chan int, size),
}
for i := start; i < (start + size); i++ {
a.allocate <- i
}
return a
} | go | func New(start, size int) Allocator {
a := &allocator{
allocate: make(chan int, size),
}
for i := start; i < (start + size); i++ {
a.allocate <- i
}
return a
} | [
"func",
"New",
"(",
"start",
",",
"size",
"int",
")",
"Allocator",
"{",
"a",
":=",
"&",
"allocator",
"{",
"allocate",
":",
"make",
"(",
"chan",
"int",
",",
"size",
")",
",",
"}",
"\n\n",
"for",
"i",
":=",
"start",
";",
"i",
"<",
"(",
"start",
"+",
"size",
")",
";",
"i",
"++",
"{",
"a",
".",
"allocate",
"<-",
"i",
"\n",
"}",
"\n\n",
"return",
"a",
"\n",
"}"
] | // New provides a new allocator | [
"New",
"provides",
"a",
"new",
"allocator"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/allocator/allocator.go#L13-L23 |
7,267 | aporeto-inc/trireme-lib | utils/allocator/allocator.go | Release | func (p *allocator) Release(item string) {
// Do not release when the channel is full. These can happen when we resync
// stopped containers.
if len(p.allocate) == cap(p.allocate) {
return
}
intItem, err := strconv.Atoi(item)
if err != nil {
return
}
p.allocate <- intItem
} | go | func (p *allocator) Release(item string) {
// Do not release when the channel is full. These can happen when we resync
// stopped containers.
if len(p.allocate) == cap(p.allocate) {
return
}
intItem, err := strconv.Atoi(item)
if err != nil {
return
}
p.allocate <- intItem
} | [
"func",
"(",
"p",
"*",
"allocator",
")",
"Release",
"(",
"item",
"string",
")",
"{",
"// Do not release when the channel is full. These can happen when we resync",
"// stopped containers.",
"if",
"len",
"(",
"p",
".",
"allocate",
")",
"==",
"cap",
"(",
"p",
".",
"allocate",
")",
"{",
"return",
"\n",
"}",
"\n\n",
"intItem",
",",
"err",
":=",
"strconv",
".",
"Atoi",
"(",
"item",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"p",
".",
"allocate",
"<-",
"intItem",
"\n",
"}"
] | // Release releases an item | [
"Release",
"releases",
"an",
"item"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/allocator/allocator.go#L31-L44 |
7,268 | aporeto-inc/trireme-lib | utils/allocator/allocator.go | ReleaseInt | func (p *allocator) ReleaseInt(item int) {
if len(p.allocate) == cap(p.allocate) || item == 0 {
return
}
p.allocate <- item
} | go | func (p *allocator) ReleaseInt(item int) {
if len(p.allocate) == cap(p.allocate) || item == 0 {
return
}
p.allocate <- item
} | [
"func",
"(",
"p",
"*",
"allocator",
")",
"ReleaseInt",
"(",
"item",
"int",
")",
"{",
"if",
"len",
"(",
"p",
".",
"allocate",
")",
"==",
"cap",
"(",
"p",
".",
"allocate",
")",
"||",
"item",
"==",
"0",
"{",
"return",
"\n",
"}",
"\n\n",
"p",
".",
"allocate",
"<-",
"item",
"\n",
"}"
] | // ReleaseInt releases an int. | [
"ReleaseInt",
"releases",
"an",
"int",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/allocator/allocator.go#L52-L58 |
7,269 | aporeto-inc/trireme-lib | monitor/internal/linux/monitor.go | Resync | func (l *LinuxMonitor) Resync(ctx context.Context) error {
return l.proc.Resync(ctx, nil)
} | go | func (l *LinuxMonitor) Resync(ctx context.Context) error {
return l.proc.Resync(ctx, nil)
} | [
"func",
"(",
"l",
"*",
"LinuxMonitor",
")",
"Resync",
"(",
"ctx",
"context",
".",
"Context",
")",
"error",
"{",
"return",
"l",
".",
"proc",
".",
"Resync",
"(",
"ctx",
",",
"nil",
")",
"\n",
"}"
] | // Resync instructs the monitor to do a resync. | [
"Resync",
"instructs",
"the",
"monitor",
"to",
"do",
"a",
"resync",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/monitor/internal/linux/monitor.go#L97-L99 |
7,270 | aporeto-inc/trireme-lib | controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go | Count | func (c *collectorImpl) Count() int {
c.Lock()
defer c.Unlock()
return len(c.Flows)
} | go | func (c *collectorImpl) Count() int {
c.Lock()
defer c.Unlock()
return len(c.Flows)
} | [
"func",
"(",
"c",
"*",
"collectorImpl",
")",
"Count",
"(",
")",
"int",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"return",
"len",
"(",
"c",
".",
"Flows",
")",
"\n",
"}"
] | // Count returns the current number of flows. | [
"Count",
"returns",
"the",
"current",
"number",
"of",
"flows",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go#L8-L13 |
7,271 | aporeto-inc/trireme-lib | controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go | GetAllRecords | func (c *collectorImpl) GetAllRecords() map[string]*collector.FlowRecord {
c.Lock()
defer c.Unlock()
if len(c.Flows) == 0 {
return nil
}
retval := c.Flows
c.Flows = make(map[string]*collector.FlowRecord)
return retval
} | go | func (c *collectorImpl) GetAllRecords() map[string]*collector.FlowRecord {
c.Lock()
defer c.Unlock()
if len(c.Flows) == 0 {
return nil
}
retval := c.Flows
c.Flows = make(map[string]*collector.FlowRecord)
return retval
} | [
"func",
"(",
"c",
"*",
"collectorImpl",
")",
"GetAllRecords",
"(",
")",
"map",
"[",
"string",
"]",
"*",
"collector",
".",
"FlowRecord",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"len",
"(",
"c",
".",
"Flows",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"retval",
":=",
"c",
".",
"Flows",
"\n",
"c",
".",
"Flows",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"*",
"collector",
".",
"FlowRecord",
")",
"\n",
"return",
"retval",
"\n",
"}"
] | // GetAllRecords should return all flow records stashed so far. | [
"GetAllRecords",
"should",
"return",
"all",
"flow",
"records",
"stashed",
"so",
"far",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go#L16-L27 |
7,272 | aporeto-inc/trireme-lib | controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go | GetUserRecords | func (c *collectorImpl) GetUserRecords() map[string]*collector.UserRecord {
c.Lock()
defer c.Unlock()
if len(c.Users) == 0 {
return nil
}
retval := c.Users
c.Users = map[string]*collector.UserRecord{}
return retval
} | go | func (c *collectorImpl) GetUserRecords() map[string]*collector.UserRecord {
c.Lock()
defer c.Unlock()
if len(c.Users) == 0 {
return nil
}
retval := c.Users
c.Users = map[string]*collector.UserRecord{}
return retval
} | [
"func",
"(",
"c",
"*",
"collectorImpl",
")",
"GetUserRecords",
"(",
")",
"map",
"[",
"string",
"]",
"*",
"collector",
".",
"UserRecord",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"len",
"(",
"c",
".",
"Users",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"retval",
":=",
"c",
".",
"Users",
"\n",
"c",
".",
"Users",
"=",
"map",
"[",
"string",
"]",
"*",
"collector",
".",
"UserRecord",
"{",
"}",
"\n",
"return",
"retval",
"\n",
"}"
] | // GetUserRecords retrieves all the user records. | [
"GetUserRecords",
"retrieves",
"all",
"the",
"user",
"records",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go#L30-L41 |
7,273 | aporeto-inc/trireme-lib | controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go | FlushUserCache | func (c *collectorImpl) FlushUserCache() {
c.Lock()
defer c.Unlock()
c.ProcessedUsers = map[string]bool{}
} | go | func (c *collectorImpl) FlushUserCache() {
c.Lock()
defer c.Unlock()
c.ProcessedUsers = map[string]bool{}
} | [
"func",
"(",
"c",
"*",
"collectorImpl",
")",
"FlushUserCache",
"(",
")",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"c",
".",
"ProcessedUsers",
"=",
"map",
"[",
"string",
"]",
"bool",
"{",
"}",
"\n",
"}"
] | // FlushUserCache flushes the user cache. | [
"FlushUserCache",
"flushes",
"the",
"user",
"cache",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go#L44-L49 |
7,274 | aporeto-inc/trireme-lib | controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go | GetAllDataPathPacketRecords | func (c *collectorImpl) GetAllDataPathPacketRecords() []*collector.PacketReport {
c.Lock()
defer c.Unlock()
record := c.DatapathPacketReports
c.DatapathPacketReports = []*collector.PacketReport{}
return record
} | go | func (c *collectorImpl) GetAllDataPathPacketRecords() []*collector.PacketReport {
c.Lock()
defer c.Unlock()
record := c.DatapathPacketReports
c.DatapathPacketReports = []*collector.PacketReport{}
return record
} | [
"func",
"(",
"c",
"*",
"collectorImpl",
")",
"GetAllDataPathPacketRecords",
"(",
")",
"[",
"]",
"*",
"collector",
".",
"PacketReport",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"record",
":=",
"c",
".",
"DatapathPacketReports",
"\n",
"c",
".",
"DatapathPacketReports",
"=",
"[",
"]",
"*",
"collector",
".",
"PacketReport",
"{",
"}",
"\n",
"return",
"record",
"\n",
"}"
] | // GetAllDataPathPacketRecords returns all datapath packet tracing records | [
"GetAllDataPathPacketRecords",
"returns",
"all",
"datapath",
"packet",
"tracing",
"records"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/remoteenforcer/internal/statscollector/collector_reader.go#L52-L59 |
7,275 | aporeto-inc/trireme-lib | utils/cache/cache.go | Add | func (r *cacheRegistry) Add(c *Cache) {
r.Lock()
defer r.Unlock()
r.items[c.name] = c
} | go | func (r *cacheRegistry) Add(c *Cache) {
r.Lock()
defer r.Unlock()
r.items[c.name] = c
} | [
"func",
"(",
"r",
"*",
"cacheRegistry",
")",
"Add",
"(",
"c",
"*",
"Cache",
")",
"{",
"r",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r",
".",
"Unlock",
"(",
")",
"\n\n",
"r",
".",
"items",
"[",
"c",
".",
"name",
"]",
"=",
"c",
"\n",
"}"
] | // Add adds a cache to a registry | [
"Add",
"adds",
"a",
"cache",
"to",
"a",
"registry"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L67-L72 |
7,276 | aporeto-inc/trireme-lib | utils/cache/cache.go | ToString | func (r *cacheRegistry) ToString() string {
r.Lock()
defer r.Unlock()
buffer := fmt.Sprintf("Cache Registry: %d\n", len(r.items))
buffer += fmt.Sprintf(" %32s : %s\n\n", "Cache Name", "max/curr")
for k, c := range r.items {
buffer += fmt.Sprintf(" %32s : %s\n", k, c.ToString())
}
return buffer
} | go | func (r *cacheRegistry) ToString() string {
r.Lock()
defer r.Unlock()
buffer := fmt.Sprintf("Cache Registry: %d\n", len(r.items))
buffer += fmt.Sprintf(" %32s : %s\n\n", "Cache Name", "max/curr")
for k, c := range r.items {
buffer += fmt.Sprintf(" %32s : %s\n", k, c.ToString())
}
return buffer
} | [
"func",
"(",
"r",
"*",
"cacheRegistry",
")",
"ToString",
"(",
")",
"string",
"{",
"r",
".",
"Lock",
"(",
")",
"\n",
"defer",
"r",
".",
"Unlock",
"(",
")",
"\n\n",
"buffer",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\n",
"\"",
",",
"len",
"(",
"r",
".",
"items",
")",
")",
"\n",
"buffer",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\n",
"\\n",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"for",
"k",
",",
"c",
":=",
"range",
"r",
".",
"items",
"{",
"buffer",
"+=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\n",
"\"",
",",
"k",
",",
"c",
".",
"ToString",
"(",
")",
")",
"\n",
"}",
"\n",
"return",
"buffer",
"\n",
"}"
] | // ToString generates information about all caches initialized through this lib | [
"ToString",
"generates",
"information",
"about",
"all",
"caches",
"initialized",
"through",
"this",
"lib"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L75-L85 |
7,277 | aporeto-inc/trireme-lib | utils/cache/cache.go | NewCacheWithExpiration | func NewCacheWithExpiration(name string, lifetime time.Duration) *Cache {
return NewCacheWithExpirationNotifier(name, lifetime, nil)
} | go | func NewCacheWithExpiration(name string, lifetime time.Duration) *Cache {
return NewCacheWithExpirationNotifier(name, lifetime, nil)
} | [
"func",
"NewCacheWithExpiration",
"(",
"name",
"string",
",",
"lifetime",
"time",
".",
"Duration",
")",
"*",
"Cache",
"{",
"return",
"NewCacheWithExpirationNotifier",
"(",
"name",
",",
"lifetime",
",",
"nil",
")",
"\n",
"}"
] | // NewCacheWithExpiration creates a new data cache | [
"NewCacheWithExpiration",
"creates",
"a",
"new",
"data",
"cache"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L94-L97 |
7,278 | aporeto-inc/trireme-lib | utils/cache/cache.go | NewCacheWithExpirationNotifier | func NewCacheWithExpirationNotifier(name string, lifetime time.Duration, expirer ExpirationNotifier) *Cache {
c := &Cache{
name: name,
data: make(map[interface{}]entry),
lifetime: lifetime,
expirer: expirer,
}
c.max = len(c.data)
registry.Add(c)
return c
} | go | func NewCacheWithExpirationNotifier(name string, lifetime time.Duration, expirer ExpirationNotifier) *Cache {
c := &Cache{
name: name,
data: make(map[interface{}]entry),
lifetime: lifetime,
expirer: expirer,
}
c.max = len(c.data)
registry.Add(c)
return c
} | [
"func",
"NewCacheWithExpirationNotifier",
"(",
"name",
"string",
",",
"lifetime",
"time",
".",
"Duration",
",",
"expirer",
"ExpirationNotifier",
")",
"*",
"Cache",
"{",
"c",
":=",
"&",
"Cache",
"{",
"name",
":",
"name",
",",
"data",
":",
"make",
"(",
"map",
"[",
"interface",
"{",
"}",
"]",
"entry",
")",
",",
"lifetime",
":",
"lifetime",
",",
"expirer",
":",
"expirer",
",",
"}",
"\n",
"c",
".",
"max",
"=",
"len",
"(",
"c",
".",
"data",
")",
"\n",
"registry",
".",
"Add",
"(",
"c",
")",
"\n",
"return",
"c",
"\n",
"}"
] | // NewCacheWithExpirationNotifier creates a new data cache with notifier | [
"NewCacheWithExpirationNotifier",
"creates",
"a",
"new",
"data",
"cache",
"with",
"notifier"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L100-L111 |
7,279 | aporeto-inc/trireme-lib | utils/cache/cache.go | ToString | func (c *Cache) ToString() string {
c.Lock()
defer c.Unlock()
return fmt.Sprintf("%d/%d", c.max, len(c.data))
} | go | func (c *Cache) ToString() string {
c.Lock()
defer c.Unlock()
return fmt.Sprintf("%d/%d", c.max, len(c.data))
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"ToString",
"(",
")",
"string",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"c",
".",
"max",
",",
"len",
"(",
"c",
".",
"data",
")",
")",
"\n",
"}"
] | // ToString provides statistics about this cache | [
"ToString",
"provides",
"statistics",
"about",
"this",
"cache"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L120-L125 |
7,280 | aporeto-inc/trireme-lib | utils/cache/cache.go | GetReset | func (c *Cache) GetReset(u interface{}, duration time.Duration) (interface{}, error) {
c.Lock()
defer c.Unlock()
if line, ok := c.data[u]; ok {
if c.lifetime != -1 && line.timer != nil {
if duration > 0 {
line.timer.Reset(duration)
} else {
line.timer.Reset(c.lifetime)
}
}
return line.value, nil
}
return nil, errors.New("cannot read item: not found")
} | go | func (c *Cache) GetReset(u interface{}, duration time.Duration) (interface{}, error) {
c.Lock()
defer c.Unlock()
if line, ok := c.data[u]; ok {
if c.lifetime != -1 && line.timer != nil {
if duration > 0 {
line.timer.Reset(duration)
} else {
line.timer.Reset(c.lifetime)
}
}
return line.value, nil
}
return nil, errors.New("cannot read item: not found")
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"GetReset",
"(",
"u",
"interface",
"{",
"}",
",",
"duration",
"time",
".",
"Duration",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"line",
",",
"ok",
":=",
"c",
".",
"data",
"[",
"u",
"]",
";",
"ok",
"{",
"if",
"c",
".",
"lifetime",
"!=",
"-",
"1",
"&&",
"line",
".",
"timer",
"!=",
"nil",
"{",
"if",
"duration",
">",
"0",
"{",
"line",
".",
"timer",
".",
"Reset",
"(",
"duration",
")",
"\n",
"}",
"else",
"{",
"line",
".",
"timer",
".",
"Reset",
"(",
"c",
".",
"lifetime",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"line",
".",
"value",
",",
"nil",
"\n",
"}",
"\n\n",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // GetReset changes the value of an entry into the cache and updates the timestamp | [
"GetReset",
"changes",
"the",
"value",
"of",
"an",
"entry",
"into",
"the",
"cache",
"and",
"updates",
"the",
"timestamp"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L162-L181 |
7,281 | aporeto-inc/trireme-lib | utils/cache/cache.go | Update | func (c *Cache) Update(u interface{}, value interface{}) (err error) {
var timer *time.Timer
if c.lifetime != -1 {
timer = time.AfterFunc(c.lifetime, func() {
if err := c.removeNotify(u, true); err != nil {
zap.L().Warn("Failed to remove item", zap.String("key", fmt.Sprintf("%v", u)))
}
})
}
t := time.Now()
c.Lock()
defer c.Unlock()
if _, ok := c.data[u]; ok {
if c.data[u].timer != nil {
c.data[u].timer.Stop()
}
c.data[u] = entry{
value: value,
timestamp: t,
timer: timer,
expirer: c.expirer,
}
return nil
}
return errors.New("cannot update item: not found")
} | go | func (c *Cache) Update(u interface{}, value interface{}) (err error) {
var timer *time.Timer
if c.lifetime != -1 {
timer = time.AfterFunc(c.lifetime, func() {
if err := c.removeNotify(u, true); err != nil {
zap.L().Warn("Failed to remove item", zap.String("key", fmt.Sprintf("%v", u)))
}
})
}
t := time.Now()
c.Lock()
defer c.Unlock()
if _, ok := c.data[u]; ok {
if c.data[u].timer != nil {
c.data[u].timer.Stop()
}
c.data[u] = entry{
value: value,
timestamp: t,
timer: timer,
expirer: c.expirer,
}
return nil
}
return errors.New("cannot update item: not found")
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Update",
"(",
"u",
"interface",
"{",
"}",
",",
"value",
"interface",
"{",
"}",
")",
"(",
"err",
"error",
")",
"{",
"var",
"timer",
"*",
"time",
".",
"Timer",
"\n",
"if",
"c",
".",
"lifetime",
"!=",
"-",
"1",
"{",
"timer",
"=",
"time",
".",
"AfterFunc",
"(",
"c",
".",
"lifetime",
",",
"func",
"(",
")",
"{",
"if",
"err",
":=",
"c",
".",
"removeNotify",
"(",
"u",
",",
"true",
")",
";",
"err",
"!=",
"nil",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Warn",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"u",
")",
")",
")",
"\n",
"}",
"\n",
"}",
")",
"\n",
"}",
"\n\n",
"t",
":=",
"time",
".",
"Now",
"(",
")",
"\n\n",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"_",
",",
"ok",
":=",
"c",
".",
"data",
"[",
"u",
"]",
";",
"ok",
"{",
"if",
"c",
".",
"data",
"[",
"u",
"]",
".",
"timer",
"!=",
"nil",
"{",
"c",
".",
"data",
"[",
"u",
"]",
".",
"timer",
".",
"Stop",
"(",
")",
"\n",
"}",
"\n\n",
"c",
".",
"data",
"[",
"u",
"]",
"=",
"entry",
"{",
"value",
":",
"value",
",",
"timestamp",
":",
"t",
",",
"timer",
":",
"timer",
",",
"expirer",
":",
"c",
".",
"expirer",
",",
"}",
"\n\n",
"return",
"nil",
"\n",
"}",
"\n\n",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // Update changes the value of an entry into the cache and updates the timestamp | [
"Update",
"changes",
"the",
"value",
"of",
"an",
"entry",
"into",
"the",
"cache",
"and",
"updates",
"the",
"timestamp"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L184-L217 |
7,282 | aporeto-inc/trireme-lib | utils/cache/cache.go | AddOrUpdate | func (c *Cache) AddOrUpdate(u interface{}, value interface{}) (updated bool) {
var timer *time.Timer
if c.lifetime != -1 {
timer = time.AfterFunc(c.lifetime, func() {
if err := c.removeNotify(u, true); err != nil {
zap.L().Warn("Failed to remove item", zap.String("key", fmt.Sprintf("%v", u)))
}
})
}
t := time.Now()
c.Lock()
defer c.Unlock()
if _, updated = c.data[u]; updated {
if c.data[u].timer != nil {
c.data[u].timer.Stop()
}
}
c.data[u] = entry{
value: value,
timestamp: t,
timer: timer,
expirer: c.expirer,
}
if len(c.data) > c.max {
c.max = len(c.data)
}
return updated
} | go | func (c *Cache) AddOrUpdate(u interface{}, value interface{}) (updated bool) {
var timer *time.Timer
if c.lifetime != -1 {
timer = time.AfterFunc(c.lifetime, func() {
if err := c.removeNotify(u, true); err != nil {
zap.L().Warn("Failed to remove item", zap.String("key", fmt.Sprintf("%v", u)))
}
})
}
t := time.Now()
c.Lock()
defer c.Unlock()
if _, updated = c.data[u]; updated {
if c.data[u].timer != nil {
c.data[u].timer.Stop()
}
}
c.data[u] = entry{
value: value,
timestamp: t,
timer: timer,
expirer: c.expirer,
}
if len(c.data) > c.max {
c.max = len(c.data)
}
return updated
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"AddOrUpdate",
"(",
"u",
"interface",
"{",
"}",
",",
"value",
"interface",
"{",
"}",
")",
"(",
"updated",
"bool",
")",
"{",
"var",
"timer",
"*",
"time",
".",
"Timer",
"\n",
"if",
"c",
".",
"lifetime",
"!=",
"-",
"1",
"{",
"timer",
"=",
"time",
".",
"AfterFunc",
"(",
"c",
".",
"lifetime",
",",
"func",
"(",
")",
"{",
"if",
"err",
":=",
"c",
".",
"removeNotify",
"(",
"u",
",",
"true",
")",
";",
"err",
"!=",
"nil",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Warn",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"u",
")",
")",
")",
"\n",
"}",
"\n",
"}",
")",
"\n",
"}",
"\n\n",
"t",
":=",
"time",
".",
"Now",
"(",
")",
"\n\n",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"_",
",",
"updated",
"=",
"c",
".",
"data",
"[",
"u",
"]",
";",
"updated",
"{",
"if",
"c",
".",
"data",
"[",
"u",
"]",
".",
"timer",
"!=",
"nil",
"{",
"c",
".",
"data",
"[",
"u",
"]",
".",
"timer",
".",
"Stop",
"(",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"c",
".",
"data",
"[",
"u",
"]",
"=",
"entry",
"{",
"value",
":",
"value",
",",
"timestamp",
":",
"t",
",",
"timer",
":",
"timer",
",",
"expirer",
":",
"c",
".",
"expirer",
",",
"}",
"\n",
"if",
"len",
"(",
"c",
".",
"data",
")",
">",
"c",
".",
"max",
"{",
"c",
".",
"max",
"=",
"len",
"(",
"c",
".",
"data",
")",
"\n",
"}",
"\n\n",
"return",
"updated",
"\n",
"}"
] | // AddOrUpdate adds a new value in the cache or updates the existing value
// if needed. If an update happens the timestamp is also updated.
// Returns true if key was updated. | [
"AddOrUpdate",
"adds",
"a",
"new",
"value",
"in",
"the",
"cache",
"or",
"updates",
"the",
"existing",
"value",
"if",
"needed",
".",
"If",
"an",
"update",
"happens",
"the",
"timestamp",
"is",
"also",
"updated",
".",
"Returns",
"true",
"if",
"key",
"was",
"updated",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L222-L255 |
7,283 | aporeto-inc/trireme-lib | utils/cache/cache.go | SetTimeOut | func (c *Cache) SetTimeOut(u interface{}, timeout time.Duration) (err error) {
c.Lock()
defer c.Unlock()
if _, ok := c.data[u]; !ok {
return errors.New("item is already deleted")
}
c.data[u].timer.Reset(timeout)
return nil
} | go | func (c *Cache) SetTimeOut(u interface{}, timeout time.Duration) (err error) {
c.Lock()
defer c.Unlock()
if _, ok := c.data[u]; !ok {
return errors.New("item is already deleted")
}
c.data[u].timer.Reset(timeout)
return nil
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"SetTimeOut",
"(",
"u",
"interface",
"{",
"}",
",",
"timeout",
"time",
".",
"Duration",
")",
"(",
"err",
"error",
")",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"_",
",",
"ok",
":=",
"c",
".",
"data",
"[",
"u",
"]",
";",
"!",
"ok",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"c",
".",
"data",
"[",
"u",
"]",
".",
"timer",
".",
"Reset",
"(",
"timeout",
")",
"\n\n",
"return",
"nil",
"\n",
"}"
] | // SetTimeOut sets the time out of an entry to a new value | [
"SetTimeOut",
"sets",
"the",
"time",
"out",
"of",
"an",
"entry",
"to",
"a",
"new",
"value"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L258-L269 |
7,284 | aporeto-inc/trireme-lib | utils/cache/cache.go | Get | func (c *Cache) Get(u interface{}) (i interface{}, err error) {
c.Lock()
defer c.Unlock()
if _, ok := c.data[u]; !ok {
return nil, errors.New("not found")
}
return c.data[u].value, nil
} | go | func (c *Cache) Get(u interface{}) (i interface{}, err error) {
c.Lock()
defer c.Unlock()
if _, ok := c.data[u]; !ok {
return nil, errors.New("not found")
}
return c.data[u].value, nil
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Get",
"(",
"u",
"interface",
"{",
"}",
")",
"(",
"i",
"interface",
"{",
"}",
",",
"err",
"error",
")",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"_",
",",
"ok",
":=",
"c",
".",
"data",
"[",
"u",
"]",
";",
"!",
"ok",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"c",
".",
"data",
"[",
"u",
"]",
".",
"value",
",",
"nil",
"\n",
"}"
] | // Get retrieves the entry from the cache | [
"Get",
"retrieves",
"the",
"entry",
"from",
"the",
"cache"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L272-L282 |
7,285 | aporeto-inc/trireme-lib | utils/cache/cache.go | KeyList | func (c *Cache) KeyList() []interface{} {
c.Lock()
defer c.Unlock()
list := []interface{}{}
for k := range c.data {
list = append(list, k)
}
return list
} | go | func (c *Cache) KeyList() []interface{} {
c.Lock()
defer c.Unlock()
list := []interface{}{}
for k := range c.data {
list = append(list, k)
}
return list
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"KeyList",
"(",
")",
"[",
"]",
"interface",
"{",
"}",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"list",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"}",
"\n",
"for",
"k",
":=",
"range",
"c",
".",
"data",
"{",
"list",
"=",
"append",
"(",
"list",
",",
"k",
")",
"\n",
"}",
"\n",
"return",
"list",
"\n",
"}"
] | // KeyList returns all the keys that are currently stored in the cache. | [
"KeyList",
"returns",
"all",
"the",
"keys",
"that",
"are",
"currently",
"stored",
"in",
"the",
"cache",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L285-L294 |
7,286 | aporeto-inc/trireme-lib | utils/cache/cache.go | removeNotify | func (c *Cache) removeNotify(u interface{}, notify bool) (err error) {
c.Lock()
defer c.Unlock()
val, ok := c.data[u]
if !ok {
return errors.New("not found")
}
if val.timer != nil {
val.timer.Stop()
}
if notify && val.expirer != nil {
val.expirer(c, u, val.value)
}
delete(c.data, u)
return nil
} | go | func (c *Cache) removeNotify(u interface{}, notify bool) (err error) {
c.Lock()
defer c.Unlock()
val, ok := c.data[u]
if !ok {
return errors.New("not found")
}
if val.timer != nil {
val.timer.Stop()
}
if notify && val.expirer != nil {
val.expirer(c, u, val.value)
}
delete(c.data, u)
return nil
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"removeNotify",
"(",
"u",
"interface",
"{",
"}",
",",
"notify",
"bool",
")",
"(",
"err",
"error",
")",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"val",
",",
"ok",
":=",
"c",
".",
"data",
"[",
"u",
"]",
"\n",
"if",
"!",
"ok",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"val",
".",
"timer",
"!=",
"nil",
"{",
"val",
".",
"timer",
".",
"Stop",
"(",
")",
"\n",
"}",
"\n\n",
"if",
"notify",
"&&",
"val",
".",
"expirer",
"!=",
"nil",
"{",
"val",
".",
"expirer",
"(",
"c",
",",
"u",
",",
"val",
".",
"value",
")",
"\n",
"}",
"\n\n",
"delete",
"(",
"c",
".",
"data",
",",
"u",
")",
"\n\n",
"return",
"nil",
"\n",
"}"
] | // removeNotify removes the entry from the cache and optionally notifies.
// returns error if not there | [
"removeNotify",
"removes",
"the",
"entry",
"from",
"the",
"cache",
"and",
"optionally",
"notifies",
".",
"returns",
"error",
"if",
"not",
"there"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L298-L319 |
7,287 | aporeto-inc/trireme-lib | utils/cache/cache.go | Remove | func (c *Cache) Remove(u interface{}) (err error) {
return c.removeNotify(u, false)
} | go | func (c *Cache) Remove(u interface{}) (err error) {
return c.removeNotify(u, false)
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"Remove",
"(",
"u",
"interface",
"{",
"}",
")",
"(",
"err",
"error",
")",
"{",
"return",
"c",
".",
"removeNotify",
"(",
"u",
",",
"false",
")",
"\n",
"}"
] | // Remove removes the entry from the cache and returns error if not there | [
"Remove",
"removes",
"the",
"entry",
"from",
"the",
"cache",
"and",
"returns",
"error",
"if",
"not",
"there"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L322-L325 |
7,288 | aporeto-inc/trireme-lib | utils/cache/cache.go | RemoveWithDelay | func (c *Cache) RemoveWithDelay(u interface{}, duration time.Duration) error {
if duration == -1 {
return c.Remove(u)
}
c.Lock()
defer c.Unlock()
e, ok := c.data[u]
if !ok {
return errors.New("cannot remove item with delay: not found")
}
timer := time.AfterFunc(duration, func() {
if err := c.Remove(u); err != nil {
zap.L().Warn("Failed to remove item with delay", zap.String("key", fmt.Sprintf("%v", u)), zap.String("delay", duration.String()))
}
})
t := time.Now()
if c.data[u].timer != nil {
c.data[u].timer.Stop()
}
c.data[u] = entry{
value: e.value,
timestamp: t,
timer: timer,
expirer: c.expirer,
}
return nil
} | go | func (c *Cache) RemoveWithDelay(u interface{}, duration time.Duration) error {
if duration == -1 {
return c.Remove(u)
}
c.Lock()
defer c.Unlock()
e, ok := c.data[u]
if !ok {
return errors.New("cannot remove item with delay: not found")
}
timer := time.AfterFunc(duration, func() {
if err := c.Remove(u); err != nil {
zap.L().Warn("Failed to remove item with delay", zap.String("key", fmt.Sprintf("%v", u)), zap.String("delay", duration.String()))
}
})
t := time.Now()
if c.data[u].timer != nil {
c.data[u].timer.Stop()
}
c.data[u] = entry{
value: e.value,
timestamp: t,
timer: timer,
expirer: c.expirer,
}
return nil
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"RemoveWithDelay",
"(",
"u",
"interface",
"{",
"}",
",",
"duration",
"time",
".",
"Duration",
")",
"error",
"{",
"if",
"duration",
"==",
"-",
"1",
"{",
"return",
"c",
".",
"Remove",
"(",
"u",
")",
"\n",
"}",
"\n\n",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"e",
",",
"ok",
":=",
"c",
".",
"data",
"[",
"u",
"]",
"\n\n",
"if",
"!",
"ok",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"timer",
":=",
"time",
".",
"AfterFunc",
"(",
"duration",
",",
"func",
"(",
")",
"{",
"if",
"err",
":=",
"c",
".",
"Remove",
"(",
"u",
")",
";",
"err",
"!=",
"nil",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Warn",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"u",
")",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"duration",
".",
"String",
"(",
")",
")",
")",
"\n",
"}",
"\n",
"}",
")",
"\n\n",
"t",
":=",
"time",
".",
"Now",
"(",
")",
"\n\n",
"if",
"c",
".",
"data",
"[",
"u",
"]",
".",
"timer",
"!=",
"nil",
"{",
"c",
".",
"data",
"[",
"u",
"]",
".",
"timer",
".",
"Stop",
"(",
")",
"\n",
"}",
"\n\n",
"c",
".",
"data",
"[",
"u",
"]",
"=",
"entry",
"{",
"value",
":",
"e",
".",
"value",
",",
"timestamp",
":",
"t",
",",
"timer",
":",
"timer",
",",
"expirer",
":",
"c",
".",
"expirer",
",",
"}",
"\n\n",
"return",
"nil",
"\n\n",
"}"
] | // RemoveWithDelay removes the entry from the cache after a certain duration | [
"RemoveWithDelay",
"removes",
"the",
"entry",
"from",
"the",
"cache",
"after",
"a",
"certain",
"duration"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L328-L363 |
7,289 | aporeto-inc/trireme-lib | utils/cache/cache.go | SizeOf | func (c *Cache) SizeOf() int {
c.Lock()
defer c.Unlock()
return len(c.data)
} | go | func (c *Cache) SizeOf() int {
c.Lock()
defer c.Unlock()
return len(c.data)
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"SizeOf",
"(",
")",
"int",
"{",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"return",
"len",
"(",
"c",
".",
"data",
")",
"\n",
"}"
] | // SizeOf returns the number of elements in the cache | [
"SizeOf",
"returns",
"the",
"number",
"of",
"elements",
"in",
"the",
"cache"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L366-L372 |
7,290 | aporeto-inc/trireme-lib | utils/cache/cache.go | LockedModify | func (c *Cache) LockedModify(u interface{}, add func(a, b interface{}) interface{}, increment interface{}) (interface{}, error) {
var timer *time.Timer
if c.lifetime != -1 {
timer = time.AfterFunc(c.lifetime, func() {
if err := c.removeNotify(u, true); err != nil {
zap.L().Warn("Failed to remove item", zap.String("key", fmt.Sprintf("%v", u)))
}
})
}
t := time.Now()
c.Lock()
defer c.Unlock()
e, ok := c.data[u]
if !ok {
return nil, errors.New("not found")
}
if e.timer != nil {
e.timer.Stop()
}
e.value = add(e.value, increment)
e.timer = timer
e.timestamp = t
e.expirer = c.expirer
c.data[u] = e
return e.value, nil
} | go | func (c *Cache) LockedModify(u interface{}, add func(a, b interface{}) interface{}, increment interface{}) (interface{}, error) {
var timer *time.Timer
if c.lifetime != -1 {
timer = time.AfterFunc(c.lifetime, func() {
if err := c.removeNotify(u, true); err != nil {
zap.L().Warn("Failed to remove item", zap.String("key", fmt.Sprintf("%v", u)))
}
})
}
t := time.Now()
c.Lock()
defer c.Unlock()
e, ok := c.data[u]
if !ok {
return nil, errors.New("not found")
}
if e.timer != nil {
e.timer.Stop()
}
e.value = add(e.value, increment)
e.timer = timer
e.timestamp = t
e.expirer = c.expirer
c.data[u] = e
return e.value, nil
} | [
"func",
"(",
"c",
"*",
"Cache",
")",
"LockedModify",
"(",
"u",
"interface",
"{",
"}",
",",
"add",
"func",
"(",
"a",
",",
"b",
"interface",
"{",
"}",
")",
"interface",
"{",
"}",
",",
"increment",
"interface",
"{",
"}",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"var",
"timer",
"*",
"time",
".",
"Timer",
"\n",
"if",
"c",
".",
"lifetime",
"!=",
"-",
"1",
"{",
"timer",
"=",
"time",
".",
"AfterFunc",
"(",
"c",
".",
"lifetime",
",",
"func",
"(",
")",
"{",
"if",
"err",
":=",
"c",
".",
"removeNotify",
"(",
"u",
",",
"true",
")",
";",
"err",
"!=",
"nil",
"{",
"zap",
".",
"L",
"(",
")",
".",
"Warn",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"u",
")",
")",
")",
"\n",
"}",
"\n",
"}",
")",
"\n",
"}",
"\n\n",
"t",
":=",
"time",
".",
"Now",
"(",
")",
"\n\n",
"c",
".",
"Lock",
"(",
")",
"\n",
"defer",
"c",
".",
"Unlock",
"(",
")",
"\n\n",
"e",
",",
"ok",
":=",
"c",
".",
"data",
"[",
"u",
"]",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"if",
"e",
".",
"timer",
"!=",
"nil",
"{",
"e",
".",
"timer",
".",
"Stop",
"(",
")",
"\n",
"}",
"\n\n",
"e",
".",
"value",
"=",
"add",
"(",
"e",
".",
"value",
",",
"increment",
")",
"\n",
"e",
".",
"timer",
"=",
"timer",
"\n",
"e",
".",
"timestamp",
"=",
"t",
"\n",
"e",
".",
"expirer",
"=",
"c",
".",
"expirer",
"\n\n",
"c",
".",
"data",
"[",
"u",
"]",
"=",
"e",
"\n\n",
"return",
"e",
".",
"value",
",",
"nil",
"\n\n",
"}"
] | // LockedModify locks the data store | [
"LockedModify",
"locks",
"the",
"data",
"store"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/utils/cache/cache.go#L375-L409 |
7,291 | aporeto-inc/trireme-lib | controller/mockcontroller/mocktrireme.go | NewMockTriremeController | func NewMockTriremeController(ctrl *gomock.Controller) *MockTriremeController {
mock := &MockTriremeController{ctrl: ctrl}
mock.recorder = &MockTriremeControllerMockRecorder{mock}
return mock
} | go | func NewMockTriremeController(ctrl *gomock.Controller) *MockTriremeController {
mock := &MockTriremeController{ctrl: ctrl}
mock.recorder = &MockTriremeControllerMockRecorder{mock}
return mock
} | [
"func",
"NewMockTriremeController",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockTriremeController",
"{",
"mock",
":=",
"&",
"MockTriremeController",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockTriremeControllerMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockTriremeController creates a new mock instance
// nolint | [
"NewMockTriremeController",
"creates",
"a",
"new",
"mock",
"instance",
"nolint"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/mockcontroller/mocktrireme.go#L35-L39 |
7,292 | aporeto-inc/trireme-lib | controller/mockcontroller/mocktrireme.go | UpdateSecrets | func (m *MockTriremeController) UpdateSecrets(secrets secrets.Secrets) error {
ret := m.ctrl.Call(m, "UpdateSecrets", secrets)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockTriremeController) UpdateSecrets(secrets secrets.Secrets) error {
ret := m.ctrl.Call(m, "UpdateSecrets", secrets)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockTriremeController",
")",
"UpdateSecrets",
"(",
"secrets",
"secrets",
".",
"Secrets",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"secrets",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // UpdateSecrets mocks base method
// nolint | [
"UpdateSecrets",
"mocks",
"base",
"method",
"nolint"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/mockcontroller/mocktrireme.go#L119-L123 |
7,293 | aporeto-inc/trireme-lib | controller/mockcontroller/mocktrireme.go | NewMockDebugInfo | func NewMockDebugInfo(ctrl *gomock.Controller) *MockDebugInfo {
mock := &MockDebugInfo{ctrl: ctrl}
mock.recorder = &MockDebugInfoMockRecorder{mock}
return mock
} | go | func NewMockDebugInfo(ctrl *gomock.Controller) *MockDebugInfo {
mock := &MockDebugInfo{ctrl: ctrl}
mock.recorder = &MockDebugInfoMockRecorder{mock}
return mock
} | [
"func",
"NewMockDebugInfo",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockDebugInfo",
"{",
"mock",
":=",
"&",
"MockDebugInfo",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockDebugInfoMockRecorder",
"{",
"mock",
"}",
"\n",
"return",
"mock",
"\n",
"}"
] | // NewMockDebugInfo creates a new mock instance
// nolint | [
"NewMockDebugInfo",
"creates",
"a",
"new",
"mock",
"instance",
"nolint"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/mockcontroller/mocktrireme.go#L188-L192 |
7,294 | aporeto-inc/trireme-lib | controller/mockcontroller/mocktrireme.go | EnableDatapathPacketTracing | func (m *MockDebugInfo) EnableDatapathPacketTracing(contextID string, direction packettracing.TracingDirection, interval time.Duration, putype common.PUType) error {
ret := m.ctrl.Call(m, "EnableDatapathPacketTracing", contextID, direction, interval, putype)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockDebugInfo) EnableDatapathPacketTracing(contextID string, direction packettracing.TracingDirection, interval time.Duration, putype common.PUType) error {
ret := m.ctrl.Call(m, "EnableDatapathPacketTracing", contextID, direction, interval, putype)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockDebugInfo",
")",
"EnableDatapathPacketTracing",
"(",
"contextID",
"string",
",",
"direction",
"packettracing",
".",
"TracingDirection",
",",
"interval",
"time",
".",
"Duration",
",",
"putype",
"common",
".",
"PUType",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"contextID",
",",
"direction",
",",
"interval",
",",
"putype",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] | // EnableDatapathPacketTracing mocks base method
// nolint | [
"EnableDatapathPacketTracing",
"mocks",
"base",
"method",
"nolint"
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/mockcontroller/mocktrireme.go#L202-L206 |
7,295 | aporeto-inc/trireme-lib | controller/pkg/usertokens/pkitokens/jwt.go | NewVerifierFromFile | func NewVerifierFromFile(jwtcertPath string, redirectURI string, redirectOnFail, redirectOnNoToken bool) (*PKIJWTVerifier, error) {
jwtCertPEM, err := ioutil.ReadFile(jwtcertPath)
if err != nil {
return nil, fmt.Errorf("failed to read JWT signing certificates or public keys from file: %s", err)
}
return NewVerifierFromPEM(jwtCertPEM, redirectURI, redirectOnFail, redirectOnNoToken)
} | go | func NewVerifierFromFile(jwtcertPath string, redirectURI string, redirectOnFail, redirectOnNoToken bool) (*PKIJWTVerifier, error) {
jwtCertPEM, err := ioutil.ReadFile(jwtcertPath)
if err != nil {
return nil, fmt.Errorf("failed to read JWT signing certificates or public keys from file: %s", err)
}
return NewVerifierFromPEM(jwtCertPEM, redirectURI, redirectOnFail, redirectOnNoToken)
} | [
"func",
"NewVerifierFromFile",
"(",
"jwtcertPath",
"string",
",",
"redirectURI",
"string",
",",
"redirectOnFail",
",",
"redirectOnNoToken",
"bool",
")",
"(",
"*",
"PKIJWTVerifier",
",",
"error",
")",
"{",
"jwtCertPEM",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"jwtcertPath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"NewVerifierFromPEM",
"(",
"jwtCertPEM",
",",
"redirectURI",
",",
"redirectOnFail",
",",
"redirectOnNoToken",
")",
"\n",
"}"
] | // NewVerifierFromFile assumes that the input is provided as file path. | [
"NewVerifierFromFile",
"assumes",
"that",
"the",
"input",
"is",
"provided",
"as",
"file",
"path",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/usertokens/pkitokens/jwt.go#L25-L31 |
7,296 | aporeto-inc/trireme-lib | controller/pkg/usertokens/pkitokens/jwt.go | NewVerifierFromPEM | func NewVerifierFromPEM(jwtCertPEM []byte, redirectURI string, redirectOnFail, redirectOnNoToken bool) (*PKIJWTVerifier, error) {
keys, err := parsePublicKeysFromPEM(jwtCertPEM)
// pay attention to the return format of parsePublicKeysFromPEM
// when checking for an error here
if keys == nil && err != nil {
return nil, fmt.Errorf("failed to read JWT signing certificates or public keys from PEM: %s", err)
}
return &PKIJWTVerifier{
JWTCertPEM: jwtCertPEM,
keys: keys,
RedirectURL: redirectURI,
}, nil
} | go | func NewVerifierFromPEM(jwtCertPEM []byte, redirectURI string, redirectOnFail, redirectOnNoToken bool) (*PKIJWTVerifier, error) {
keys, err := parsePublicKeysFromPEM(jwtCertPEM)
// pay attention to the return format of parsePublicKeysFromPEM
// when checking for an error here
if keys == nil && err != nil {
return nil, fmt.Errorf("failed to read JWT signing certificates or public keys from PEM: %s", err)
}
return &PKIJWTVerifier{
JWTCertPEM: jwtCertPEM,
keys: keys,
RedirectURL: redirectURI,
}, nil
} | [
"func",
"NewVerifierFromPEM",
"(",
"jwtCertPEM",
"[",
"]",
"byte",
",",
"redirectURI",
"string",
",",
"redirectOnFail",
",",
"redirectOnNoToken",
"bool",
")",
"(",
"*",
"PKIJWTVerifier",
",",
"error",
")",
"{",
"keys",
",",
"err",
":=",
"parsePublicKeysFromPEM",
"(",
"jwtCertPEM",
")",
"\n",
"// pay attention to the return format of parsePublicKeysFromPEM",
"// when checking for an error here",
"if",
"keys",
"==",
"nil",
"&&",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"return",
"&",
"PKIJWTVerifier",
"{",
"JWTCertPEM",
":",
"jwtCertPEM",
",",
"keys",
":",
"keys",
",",
"RedirectURL",
":",
"redirectURI",
",",
"}",
",",
"nil",
"\n",
"}"
] | // NewVerifierFromPEM assumes that the input is a PEM byte array. | [
"NewVerifierFromPEM",
"assumes",
"that",
"the",
"input",
"is",
"a",
"PEM",
"byte",
"array",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/usertokens/pkitokens/jwt.go#L34-L46 |
7,297 | aporeto-inc/trireme-lib | controller/pkg/usertokens/pkitokens/jwt.go | NewVerifier | func NewVerifier(v *PKIJWTVerifier) (*PKIJWTVerifier, error) {
if len(v.JWTCertPEM) == 0 {
return v, nil
}
keys, err := parsePublicKeysFromPEM(v.JWTCertPEM)
// pay attention to the return format of parsePublicKeysFromPEM
// when checking for an error here
if keys == nil && err != nil {
return nil, fmt.Errorf("failed to parse JWT signing certificates or public keys from PEM: %s", err)
}
v.keys = keys
return v, nil
} | go | func NewVerifier(v *PKIJWTVerifier) (*PKIJWTVerifier, error) {
if len(v.JWTCertPEM) == 0 {
return v, nil
}
keys, err := parsePublicKeysFromPEM(v.JWTCertPEM)
// pay attention to the return format of parsePublicKeysFromPEM
// when checking for an error here
if keys == nil && err != nil {
return nil, fmt.Errorf("failed to parse JWT signing certificates or public keys from PEM: %s", err)
}
v.keys = keys
return v, nil
} | [
"func",
"NewVerifier",
"(",
"v",
"*",
"PKIJWTVerifier",
")",
"(",
"*",
"PKIJWTVerifier",
",",
"error",
")",
"{",
"if",
"len",
"(",
"v",
".",
"JWTCertPEM",
")",
"==",
"0",
"{",
"return",
"v",
",",
"nil",
"\n",
"}",
"\n",
"keys",
",",
"err",
":=",
"parsePublicKeysFromPEM",
"(",
"v",
".",
"JWTCertPEM",
")",
"\n",
"// pay attention to the return format of parsePublicKeysFromPEM",
"// when checking for an error here",
"if",
"keys",
"==",
"nil",
"&&",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n",
"v",
".",
"keys",
"=",
"keys",
"\n",
"return",
"v",
",",
"nil",
"\n",
"}"
] | // NewVerifier creates a new verifier from the provided configuration. | [
"NewVerifier",
"creates",
"a",
"new",
"verifier",
"from",
"the",
"provided",
"configuration",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/usertokens/pkitokens/jwt.go#L49-L61 |
7,298 | aporeto-inc/trireme-lib | controller/pkg/usertokens/pkitokens/jwt.go | Validate | func (j *PKIJWTVerifier) Validate(ctx context.Context, tokenString string) ([]string, bool, string, error) {
if len(tokenString) == 0 {
return []string{}, false, tokenString, fmt.Errorf("Empty token")
}
if len(j.keys) == 0 {
return []string{}, false, tokenString, fmt.Errorf("No public keys loaded into verifier")
}
// iterate over all public keys that we have and try to validate the token
// the first one to succeed will be used
var errs []error
for _, key := range j.keys {
claims := &jwt.MapClaims{}
token, err := jwt.ParseWithClaims(tokenString, claims, func(token *jwt.Token) (interface{}, error) {
switch token.Method.(type) {
case *jwt.SigningMethodECDSA:
if isECDSAPublicKey(key) {
return key, nil
}
case *jwt.SigningMethodRSA:
if isRSAPublicKey(key) {
return key, nil
}
default:
return nil, fmt.Errorf("unsupported signing method '%T'", token.Method)
}
return nil, fmt.Errorf("signing method '%T' and public key type '%T' mismatch", token.Method, key)
})
// cover all error cases after parsing/verifying
if err != nil {
errs = append(errs, err)
continue
}
if token == nil {
errs = append(errs, fmt.Errorf("no token was parsed"))
continue
}
if !token.Valid {
errs = append(errs, fmt.Errorf("token failed to verify against public key"))
continue
}
// return successful on match/verification with the first key
attributes := []string{}
for k, v := range *claims {
attributes = append(attributes, common.FlattenClaim(k, v)...)
}
return attributes, false, tokenString, nil
}
// generate a detailed error
var detailedError string
for i, err := range errs {
detailedError += err.Error()
if i+1 < len(errs) {
detailedError += "; "
}
}
return []string{}, false, tokenString, fmt.Errorf("Invalid token - errors: [%s]", detailedError)
} | go | func (j *PKIJWTVerifier) Validate(ctx context.Context, tokenString string) ([]string, bool, string, error) {
if len(tokenString) == 0 {
return []string{}, false, tokenString, fmt.Errorf("Empty token")
}
if len(j.keys) == 0 {
return []string{}, false, tokenString, fmt.Errorf("No public keys loaded into verifier")
}
// iterate over all public keys that we have and try to validate the token
// the first one to succeed will be used
var errs []error
for _, key := range j.keys {
claims := &jwt.MapClaims{}
token, err := jwt.ParseWithClaims(tokenString, claims, func(token *jwt.Token) (interface{}, error) {
switch token.Method.(type) {
case *jwt.SigningMethodECDSA:
if isECDSAPublicKey(key) {
return key, nil
}
case *jwt.SigningMethodRSA:
if isRSAPublicKey(key) {
return key, nil
}
default:
return nil, fmt.Errorf("unsupported signing method '%T'", token.Method)
}
return nil, fmt.Errorf("signing method '%T' and public key type '%T' mismatch", token.Method, key)
})
// cover all error cases after parsing/verifying
if err != nil {
errs = append(errs, err)
continue
}
if token == nil {
errs = append(errs, fmt.Errorf("no token was parsed"))
continue
}
if !token.Valid {
errs = append(errs, fmt.Errorf("token failed to verify against public key"))
continue
}
// return successful on match/verification with the first key
attributes := []string{}
for k, v := range *claims {
attributes = append(attributes, common.FlattenClaim(k, v)...)
}
return attributes, false, tokenString, nil
}
// generate a detailed error
var detailedError string
for i, err := range errs {
detailedError += err.Error()
if i+1 < len(errs) {
detailedError += "; "
}
}
return []string{}, false, tokenString, fmt.Errorf("Invalid token - errors: [%s]", detailedError)
} | [
"func",
"(",
"j",
"*",
"PKIJWTVerifier",
")",
"Validate",
"(",
"ctx",
"context",
".",
"Context",
",",
"tokenString",
"string",
")",
"(",
"[",
"]",
"string",
",",
"bool",
",",
"string",
",",
"error",
")",
"{",
"if",
"len",
"(",
"tokenString",
")",
"==",
"0",
"{",
"return",
"[",
"]",
"string",
"{",
"}",
",",
"false",
",",
"tokenString",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"len",
"(",
"j",
".",
"keys",
")",
"==",
"0",
"{",
"return",
"[",
"]",
"string",
"{",
"}",
",",
"false",
",",
"tokenString",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// iterate over all public keys that we have and try to validate the token",
"// the first one to succeed will be used",
"var",
"errs",
"[",
"]",
"error",
"\n",
"for",
"_",
",",
"key",
":=",
"range",
"j",
".",
"keys",
"{",
"claims",
":=",
"&",
"jwt",
".",
"MapClaims",
"{",
"}",
"\n",
"token",
",",
"err",
":=",
"jwt",
".",
"ParseWithClaims",
"(",
"tokenString",
",",
"claims",
",",
"func",
"(",
"token",
"*",
"jwt",
".",
"Token",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"switch",
"token",
".",
"Method",
".",
"(",
"type",
")",
"{",
"case",
"*",
"jwt",
".",
"SigningMethodECDSA",
":",
"if",
"isECDSAPublicKey",
"(",
"key",
")",
"{",
"return",
"key",
",",
"nil",
"\n",
"}",
"\n",
"case",
"*",
"jwt",
".",
"SigningMethodRSA",
":",
"if",
"isRSAPublicKey",
"(",
"key",
")",
"{",
"return",
"key",
",",
"nil",
"\n",
"}",
"\n",
"default",
":",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"token",
".",
"Method",
")",
"\n",
"}",
"\n",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"token",
".",
"Method",
",",
"key",
")",
"\n",
"}",
")",
"\n\n",
"// cover all error cases after parsing/verifying",
"if",
"err",
"!=",
"nil",
"{",
"errs",
"=",
"append",
"(",
"errs",
",",
"err",
")",
"\n",
"continue",
"\n",
"}",
"\n",
"if",
"token",
"==",
"nil",
"{",
"errs",
"=",
"append",
"(",
"errs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
")",
"\n",
"continue",
"\n",
"}",
"\n",
"if",
"!",
"token",
".",
"Valid",
"{",
"errs",
"=",
"append",
"(",
"errs",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
")",
"\n",
"continue",
"\n",
"}",
"\n\n",
"// return successful on match/verification with the first key",
"attributes",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"*",
"claims",
"{",
"attributes",
"=",
"append",
"(",
"attributes",
",",
"common",
".",
"FlattenClaim",
"(",
"k",
",",
"v",
")",
"...",
")",
"\n",
"}",
"\n",
"return",
"attributes",
",",
"false",
",",
"tokenString",
",",
"nil",
"\n",
"}",
"\n\n",
"// generate a detailed error",
"var",
"detailedError",
"string",
"\n",
"for",
"i",
",",
"err",
":=",
"range",
"errs",
"{",
"detailedError",
"+=",
"err",
".",
"Error",
"(",
")",
"\n",
"if",
"i",
"+",
"1",
"<",
"len",
"(",
"errs",
")",
"{",
"detailedError",
"+=",
"\"",
"\"",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"[",
"]",
"string",
"{",
"}",
",",
"false",
",",
"tokenString",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"detailedError",
")",
"\n",
"}"
] | // Validate parses a generic JWT token and flattens the claims in a normalized form. It
// assumes that any of the JWT signing certs or public keys will validate the token. | [
"Validate",
"parses",
"a",
"generic",
"JWT",
"token",
"and",
"flattens",
"the",
"claims",
"in",
"a",
"normalized",
"form",
".",
"It",
"assumes",
"that",
"any",
"of",
"the",
"JWT",
"signing",
"certs",
"or",
"public",
"keys",
"will",
"validate",
"the",
"token",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/usertokens/pkitokens/jwt.go#L65-L125 |
7,299 | aporeto-inc/trireme-lib | controller/pkg/usertokens/pkitokens/jwt.go | Callback | func (j *PKIJWTVerifier) Callback(r *http.Request) (string, string, int, error) {
return "", "", 0, nil
} | go | func (j *PKIJWTVerifier) Callback(r *http.Request) (string, string, int, error) {
return "", "", 0, nil
} | [
"func",
"(",
"j",
"*",
"PKIJWTVerifier",
")",
"Callback",
"(",
"r",
"*",
"http",
".",
"Request",
")",
"(",
"string",
",",
"string",
",",
"int",
",",
"error",
")",
"{",
"return",
"\"",
"\"",
",",
"\"",
"\"",
",",
"0",
",",
"nil",
"\n",
"}"
] | // Callback is called by an IDP. Not implemented here. No central authorizer for the tokens. | [
"Callback",
"is",
"called",
"by",
"an",
"IDP",
".",
"Not",
"implemented",
"here",
".",
"No",
"central",
"authorizer",
"for",
"the",
"tokens",
"."
] | 009258cf9b4f3f70f71994d9fadebe564f7e0437 | https://github.com/aporeto-inc/trireme-lib/blob/009258cf9b4f3f70f71994d9fadebe564f7e0437/controller/pkg/usertokens/pkitokens/jwt.go#L133-L135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.