Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
pkg/serverstate: Add ons & Add On definitions.
Browse files Browse the repository at this point in the history
Add new interface methods to boltdbstate as well, but not implemented.
  • Loading branch information
paladin-devops committed Jul 10, 2023
1 parent f880fcd commit c50f570
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
53 changes: 53 additions & 0 deletions internal/server/boltdbstate/add_on.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package boltdbstate

import (
"context"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

pb "github.com/hashicorp/waypoint/pkg/server/gen"
)

func (s *State) AddOnDefinitionPut(ctx context.Context, definition *pb.AddOnDefinition) (*pb.AddOnDefinition, error) {
return nil, status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnDefinitionUpdate(ctx context.Context, definition *pb.AddOnDefinition) (*pb.AddOnDefinition, error) {
return nil, status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnDefinitionGet(ctx context.Context, definition *pb.Ref_AddOnDefinition) (*pb.AddOnDefinition, error) {
return nil, status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnDefinitionDelete(ctx context.Context, definition *pb.Ref_AddOnDefinition) error {
return status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnDefinitionList(ctx context.Context, request *pb.PaginationRequest) ([]*pb.AddOnDefinition, error) {
return nil, status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnPut(ctx context.Context, addOn *pb.AddOn) (*pb.AddOn, error) {
return nil, status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnUpdate(ctx context.Context, addOn *pb.AddOn) (*pb.AddOn, error) {
return nil, status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnGet(ctx context.Context, addOn *pb.Ref_AddOn) (*pb.AddOn, error) {
return nil, status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnDelete(ctx context.Context, addOn *pb.Ref_AddOn) error {
return status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}

func (s *State) AddOnList(ctx context.Context, request *pb.PaginationRequest) ([]*pb.AddOn, error) {
return nil, status.Errorf(codes.Unimplemented, "Add On Unimplemented")
}
19 changes: 19 additions & 0 deletions pkg/serverstate/serverstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,30 @@ type Interface interface {

//---------------------------------------------------------------
// Templates

CreateProjectTemplate(context.Context, *pb.ProjectTemplate) (*pb.ProjectTemplate, error)
UpdateProjectTemplate(context.Context, *pb.ProjectTemplate) (*pb.ProjectTemplate, error)
GetProjectTemplate(context.Context, *pb.Ref_ProjectTemplate) (*pb.ProjectTemplate, error)
DeleteProjectTemplate(context.Context, *pb.Ref_ProjectTemplate) error
ListProjectTemplates(context.Context, *pb.ListProjectTemplatesRequest) ([]*pb.ProjectTemplate, error)

//---------------------------------------------------------------
// Add On Definitions

AddOnDefinitionPut(ctx context.Context, definition *pb.AddOnDefinition) (*pb.AddOnDefinition, error)
AddOnDefinitionUpdate(ctx context.Context, definition *pb.AddOnDefinition) (*pb.AddOnDefinition, error)
AddOnDefinitionGet(ctx context.Context, definition *pb.Ref_AddOnDefinition) (*pb.AddOnDefinition, error)
AddOnDefinitionDelete(ctx context.Context, definition *pb.Ref_AddOnDefinition) error
AddOnDefinitionList(ctx context.Context, request *pb.PaginationRequest) ([]*pb.AddOnDefinition, error)

//---------------------------------------------------------------
// Add Ons

AddOnPut(ctx context.Context, addOn *pb.AddOn) (*pb.AddOn, error)
AddOnUpdate(ctx context.Context, addOn *pb.AddOn) (*pb.AddOn, error)
AddOnGet(ctx context.Context, addOn *pb.Ref_AddOn) (*pb.AddOn, error)
AddOnDelete(ctx context.Context, addOn *pb.Ref_AddOn) error
AddOnList(ctx context.Context, request *pb.PaginationRequest) ([]*pb.AddOn, error)
}

// Pruner is implemented by state storage implementations that require
Expand Down

0 comments on commit c50f570

Please sign in to comment.