Rename LogViewerOrganizationConfig to OrganizationLogViewerConfig

Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
pull/3806/head
Alirie Gray 2018-07-10 12:05:29 -07:00
parent 0a8dac4a07
commit 805faa12d0
3 changed files with 8 additions and 8 deletions

View File

@ -318,8 +318,8 @@ func NewMux(opts MuxOpts, service Service) http.Handler {
// Organization config settings for Chronograf // Organization config settings for Chronograf
router.GET("/chronograf/v1/org_config", EnsureViewer(service.OrganizationConfig)) router.GET("/chronograf/v1/org_config", EnsureViewer(service.OrganizationConfig))
router.GET("/chronograf/v1/org_config/logviewer", EnsureViewer(service.LogViewerOrganizationConfig)) router.GET("/chronograf/v1/org_config/logviewer", EnsureViewer(service.OrganizationLogViewerConfig))
router.PUT("/chronograf/v1/org_config/logviewer", EnsureEditor(service.ReplaceLogViewerOrganizationConfig)) router.PUT("/chronograf/v1/org_config/logviewer", EnsureEditor(service.ReplaceOrganizationLogViewerConfig))
router.GET("/chronograf/v1/env", EnsureViewer(service.Environment)) router.GET("/chronograf/v1/env", EnsureViewer(service.Environment))

View File

@ -57,8 +57,8 @@ func (s *Service) OrganizationConfig(w http.ResponseWriter, r *http.Request) {
encodeJSON(w, http.StatusOK, res, s.Logger) encodeJSON(w, http.StatusOK, res, s.Logger)
} }
// LogViewerOrganizationConfig retrieves the log viewer UI section of the organization config // OrganizationLogViewerConfig retrieves the log viewer UI section of the organization config
func (s *Service) LogViewerOrganizationConfig(w http.ResponseWriter, r *http.Request) { func (s *Service) OrganizationLogViewerConfig(w http.ResponseWriter, r *http.Request) {
ctx := r.Context() ctx := r.Context()
orgID, ok := hasOrganizationContext(ctx) orgID, ok := hasOrganizationContext(ctx)
@ -83,8 +83,8 @@ func (s *Service) LogViewerOrganizationConfig(w http.ResponseWriter, r *http.Req
encodeJSON(w, http.StatusOK, res, s.Logger) encodeJSON(w, http.StatusOK, res, s.Logger)
} }
// ReplaceLogViewerOrganizationConfig replaces the log viewer UI section of the organization config // ReplaceOrganizationLogViewerConfig replaces the log viewer UI section of the organization config
func (s *Service) ReplaceLogViewerOrganizationConfig(w http.ResponseWriter, r *http.Request) { func (s *Service) ReplaceOrganizationLogViewerConfig(w http.ResponseWriter, r *http.Request) {
ctx := r.Context() ctx := r.Context()
orgID, ok := hasOrganizationContext(ctx) orgID, ok := hasOrganizationContext(ctx)

View File

@ -281,7 +281,7 @@ func TestLogViewerOrganizationConfig(t *testing.T) {
ctx := context.WithValue(r.Context(), organizations.ContextKey, tt.args.organizationID) ctx := context.WithValue(r.Context(), organizations.ContextKey, tt.args.organizationID)
r = r.WithContext(ctx) r = r.WithContext(ctx)
s.LogViewerOrganizationConfig(w, r) s.OrganizationLogViewerConfig(w, r)
resp := w.Result() resp := w.Result()
content := resp.Header.Get("Content-Type") content := resp.Header.Get("Content-Type")
@ -683,7 +683,7 @@ func TestReplaceLogViewerOrganizationConfig(t *testing.T) {
buf, _ := json.Marshal(tt.args.payload) buf, _ := json.Marshal(tt.args.payload)
r.Body = ioutil.NopCloser(bytes.NewReader(buf)) r.Body = ioutil.NopCloser(bytes.NewReader(buf))
s.ReplaceLogViewerOrganizationConfig(w, r) s.ReplaceOrganizationLogViewerConfig(w, r)
resp := w.Result() resp := w.Result()
content := resp.Header.Get("Content-Type") content := resp.Header.Get("Content-Type")