Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Make CallAPI public #334

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions graylog/client/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ import (

func (client *Client) callGet(
ctx context.Context, endpoint string, input, output interface{}) (*ErrorInfo, error) {
return client.callAPI(ctx, http.MethodGet, endpoint, input, output)
return client.CallAPI(ctx, http.MethodGet, endpoint, input, output)
}

func (client *Client) callPost(
ctx context.Context, endpoint string, input, output interface{}) (*ErrorInfo, error) {
return client.callAPI(ctx, http.MethodPost, endpoint, input, output)
return client.CallAPI(ctx, http.MethodPost, endpoint, input, output)
}

func (client *Client) callPut(
ctx context.Context, endpoint string, input, output interface{}) (*ErrorInfo, error) {
return client.callAPI(ctx, http.MethodPut, endpoint, input, output)
return client.CallAPI(ctx, http.MethodPut, endpoint, input, output)
}

func (client *Client) callDelete(
ctx context.Context, endpoint string, input, output interface{}) (*ErrorInfo, error) {
return client.callAPI(ctx, http.MethodDelete, endpoint, input, output)
return client.CallAPI(ctx, http.MethodDelete, endpoint, input, output)
}

func (client *Client) callAPI(
func (client *Client) CallAPI(
ctx context.Context, method, endpoint string, input, output interface{},
) (*ErrorInfo, error) {
// prepare request
Expand Down