cmd

package
v0.0.0-...-8b3e9c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

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

View Source
const (
	// ServerAddress represents gRPC server address
	ServerAddress = "localhost:5000"

	// ClientTimeout represents timeout duration
	ClientTimeout = 1 * time.Second
)
View Source
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

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL