Skip to content

Commit

Permalink
chore: add UpdateFeature (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
kentakozuka authored Jun 11, 2024
1 parent f0ad1fb commit 9259bed
Show file tree
Hide file tree
Showing 24 changed files with 6,115 additions and 3,259 deletions.
4 changes: 2 additions & 2 deletions manifests/bucketeer/charts/web-gateway/values.yaml

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions pkg/backend/api/api_grpc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2024 The Bucketeer Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package api

import (
"context"

"go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

backendproto "github.com/bucketeer-io/bucketeer/proto/backend"
)

type options struct {
logger *zap.Logger
}

type Option func(*options)

func WithLogger(l *zap.Logger) Option {
return func(opts *options) {
opts.logger = l
}
}

type BackendService struct {
opts *options
logger *zap.Logger
}

func NewBackendService(
opts ...Option,
) *BackendService {
dopts := &options{
logger: zap.NewNop(),
}
for _, opt := range opts {
opt(dopts)
}
return &BackendService{
opts: dopts,
logger: dopts.logger.Named("backend/api"),
}
}

func (s *BackendService) GetFeature(
ctx context.Context,
req *backendproto.GetFeatureRequest,
) (*backendproto.GetFeatureResponse, error) {
return nil, status.Error(codes.Unimplemented, "method not implemented")
}

func (s *BackendService) UpdateFeature(
ctx context.Context,
req *backendproto.UpdateFeatureRequest,
) (*backendproto.UpdateFeatureResponse, error) {
return nil, status.Error(codes.Unimplemented, "method not implemented")
}
8 changes: 8 additions & 0 deletions pkg/domainevent/domain/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ func LocalizedMessage(eventType proto.Event_Type, localizer locale.Localizer) *p
localizer.MustLocalizeWithTemplate(locale.FeatureFlag),
),
}
case proto.Event_FEATURE_UPDATED:
return &proto.LocalizedMessage{
Locale: localizer.GetLocale(),
Message: localizer.MustLocalizeWithTemplate(
locale.UpdatedTemplate,
localizer.MustLocalizeWithTemplate(locale.FeatureFlag),
),
}
case proto.Event_FEATURE_RENAMED:
return &proto.LocalizedMessage{
Locale: localizer.GetLocale(),
Expand Down
7 changes: 7 additions & 0 deletions pkg/feature/api/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,13 @@ func (s *FeatureService) CreateFeature(
return &featureproto.CreateFeatureResponse{}, nil
}

func (s *FeatureService) UpdateFeature(
ctx context.Context,
req *featureproto.UpdateFeatureRequest,
) (*featureproto.UpdateFeatureResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UpdateFeatureDetails not implemented")
}

func (s *FeatureService) UpdateFeatureDetails(
ctx context.Context,
req *featureproto.UpdateFeatureDetailsRequest,
Expand Down
20 changes: 20 additions & 0 deletions pkg/feature/client/mock/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified proto/auditlog/proto_descriptor.pb
Binary file not shown.
Loading

0 comments on commit 9259bed

Please sign in to comment.