Documentation ¶
Overview ¶
Package cmd includes CLI commands
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
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 cmd includes CLI commands ¶
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
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 cmd includes CLI commands ¶
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
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.
Index ¶
- Constants
- func Execute()
- type Server
- func (svr *Server) DeleteMovie(ctx context.Context, req *pb.DeleteMovieRequest) (*pb.DeleteMovieResponse, error)
- func (svr *Server) GetMovie(ctx context.Context, req *pb.GetMovieRequest) (*pb.GetMovieResponse, error)
- func (svr *Server) GetMovies(ctx context.Context, _ *pb.GetMoviesRequest) (*pb.GetMoviesResponse, error)
- func (svr *Server) PutMovie(ctx context.Context, req *pb.PutMovieRequest) (*pb.PutMovieResponse, error)
Constants ¶
const ( // ServerAddress represents gRPC server address ServerAddress = "localhost:5000" // ClientTimeout represents timeout duration ClientTimeout = 1 * time.Second )
const ( // ServerPort is gRPC server port ServerPort = ":5000" // MongoUri are used to connect to MongoDB MongoUri = "mongodb://localhost:27017" // MongoDatabase specifies database to connect MongoDatabase = "grpc" // MongoCollection specifies collection to connect MongoCollection = "example" // MongoTimeout represents Mongo timeout duration MongoTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
pb.UnimplementedMovieSvcServer
}
Server implements movie service server
func (*Server) DeleteMovie ¶
func (svr *Server) DeleteMovie(ctx context.Context, req *pb.DeleteMovieRequest) (*pb.DeleteMovieResponse, error)
DeleteMovie method delete a specified movie if exists
func (*Server) GetMovie ¶
func (svr *Server) GetMovie(ctx context.Context, req *pb.GetMovieRequest) (*pb.GetMovieResponse, error)
GetMovie method retrieve a specified movie if exists
func (*Server) GetMovies ¶
func (svr *Server) GetMovies(ctx context.Context, _ *pb.GetMoviesRequest) (*pb.GetMoviesResponse, error)
GetMovies method retrieve all movies
func (*Server) PutMovie ¶
func (svr *Server) PutMovie(ctx context.Context, req *pb.PutMovieRequest) (*pb.PutMovieResponse, error)
PutMovie method create a movie or update a existed movie