Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EEnvironmentFetch = status.Error( codes.Internal, "error occurred while fetching environment", )
EEnvironmentFetch is a GRPC error that is returned when unknown error occurs while fetching an environment.
var EEnvironmentIDCast = status.Error( codes.Internal, "could not create a new environment", )
EEnvironmentIDCast is a GRPC error that is returned when the ID of the environment could not be cast.
var EEnvironmentNameTaken = status.Error( codes.AlreadyExists, "an environment with that name already exists", )
EEnvironmentNameTaken is a GRPC error that is returned when creating a new environment and the provided environment name is already taken.
var EEnvironmentNotFound = status.Error(codes.NotFound, "environment not found")
EEnvironmentNotFound is a GRPC error that is returned when no environments are found for the provided query.
var EEnvironmentSave = status.Error( codes.Internal, "could not create a new environment", )
EEnvironmentSave is a GRPC error that is returned when an unknown error occurs while creating a new environment.
var EEnvironmentTxn = status.Error( codes.Internal, "could not create a transaction session", )
EEnvironmentTxn is a GRPC error that is returned when a new session for starting a transaction could not be created.
Functions ¶
Types ¶
type Environment ¶
type EnvironmentRepository ¶
type EnvironmentRepository interface { // Creates a new `Environment` document. Save( ctx context.Context, environment *Environment, ) (*mongo.InsertOneResult, error) // Gets an `Environment` by it's object ID. GetByID(ctx context.Context, id primitive.ObjectID) (*Environment, error) // Gets an environment by it's name and the project ID. GetByNameAndProjectID( ctx context.Context, environmentName string, projectID primitive.ObjectID, ) (*Environment, error) }
type EnvironmentServer ¶
type EnvironmentServer struct { environmentpb.UnimplementedEnvironmentServer // contains filtered or unexported fields }
func NewEnvironmentServer ¶
func NewEnvironmentServer( client *mongo.Client, userRepo user.UserRepository, projectRepo project.ProjectRepository, flagSettingRepo flagsetting.FlagSettingRepository, environmentRepo EnvironmentRepository, ) *EnvironmentServer
func (*EnvironmentServer) CreateEnvironment ¶
func (s *EnvironmentServer) CreateEnvironment( ctx context.Context, req *environmentpb.CreateEnvironmentRequest, ) (*environmentpb.CreateEnvironmentResponse, error)