Documentation ¶
Index ¶
- Constants
- Variables
- func GetCreds(conf *Config) (credentials.TransportCredentials, error)
- type Authenticator
- type Config
- type Server
- func (s *Server) AddCategory(_ context.Context, request *pb.AddCategoryRequest) (*pb.ResponseStatus, error)
- func (s *Server) AddExercise(_ context.Context, request *pb.AddExerciseRequest) (*pb.ResponseStatus, error)
- func (s *Server) DeleteCategory(_ context.Context, request *pb.DeleteCategoryRequest) (*pb.ResponseStatus, error)
- func (s *Server) DeleteExercisesByTags(_ context.Context, request *pb.DeleteExercisesByTagsRequest) (*pb.ResponseStatus, error)
- func (s *Server) GetCategories(_ context.Context, _ *pb.Empty) (*pb.GetCategoriesResponse, error)
- func (s *Server) GetExercises(_ context.Context, _ *pb.Empty) (*pb.GetExercisesShortResponse, error)
- func (s *Server) GetExercisesByCategory(_ context.Context, request *pb.GetExercisesByCategoryRequest) (*pb.GetExercisesShortResponse, error)
- func (s *Server) GetExercisesByTags(_ context.Context, request *pb.GetExercisesByTagsRequest) (*pb.GetExercisesResponse, error)
- func (s *Server) GrpcOpts(conf *Config) ([]grpc.ServerOption, error)
- func (s *Server) NewGRPCServer(opts ...grpc.ServerOption) *grpc.Server
- func (s *Server) UpdateCategory(_ context.Context, request *pb.UpdateCategoryRequest) (*pb.ResponseStatus, error)
- func (s *Server) UpdateExercise(_ context.Context, request *pb.UpdateExerciseRequest) (*pb.ResponseStatus, error)
- func (s *Server) UpdateStatus(_ context.Context, _ *pb.Empty) (*pb.ResponseStatus, error)
Constants ¶
View Source
const ( DefaultAuth = "authkey" DefaultSign = "signkey" )
View Source
const (
AuthKey = "au"
)
Variables ¶
Functions ¶
func GetCreds ¶
func GetCreds(conf *Config) (credentials.TransportCredentials, error)
Types ¶
type Authenticator ¶
func NewAuthenticator ¶
func NewAuthenticator(Skey, AKey string) Authenticator
type Config ¶
type Config struct { Host string `yaml:"host"` Port uint `yaml:"port"` //gRPC endpoint AuthKey string `yaml:"auth-key"` SignKey string `yaml:"sign-key"` DB struct { Host string `yaml:"host"` CertFile string `yaml:"certFile"` } `yaml:"db"` TLS struct { Enabled bool `yaml:"enabled"` CertFile string `yaml:"certFile"` CertKey string `yaml:"certKey"` CAFile string `yaml:"caFile"` } `tls:"tls,omitempty"` }
func NewConfigFromFile ¶
type Server ¶
type Server struct { pb.UnimplementedExerciseStoreServer // contains filtered or unexported fields }
func (*Server) AddCategory ¶
func (s *Server) AddCategory(_ context.Context, request *pb.AddCategoryRequest) (*pb.ResponseStatus, error)
func (*Server) AddExercise ¶
func (s *Server) AddExercise(_ context.Context, request *pb.AddExerciseRequest) (*pb.ResponseStatus, error)
func (*Server) DeleteCategory ¶
func (s *Server) DeleteCategory(_ context.Context, request *pb.DeleteCategoryRequest) (*pb.ResponseStatus, error)
func (*Server) DeleteExercisesByTags ¶
func (s *Server) DeleteExercisesByTags(_ context.Context, request *pb.DeleteExercisesByTagsRequest) (*pb.ResponseStatus, error)
func (*Server) GetCategories ¶
func (*Server) GetExercises ¶
func (*Server) GetExercisesByCategory ¶
func (s *Server) GetExercisesByCategory(_ context.Context, request *pb.GetExercisesByCategoryRequest) (*pb.GetExercisesShortResponse, error)
func (*Server) GetExercisesByTags ¶
func (s *Server) GetExercisesByTags(_ context.Context, request *pb.GetExercisesByTagsRequest) (*pb.GetExercisesResponse, error)
func (*Server) NewGRPCServer ¶
func (s *Server) NewGRPCServer(opts ...grpc.ServerOption) *grpc.Server
func (*Server) UpdateCategory ¶
func (s *Server) UpdateCategory(_ context.Context, request *pb.UpdateCategoryRequest) (*pb.ResponseStatus, error)
func (*Server) UpdateExercise ¶
func (s *Server) UpdateExercise(_ context.Context, request *pb.UpdateExerciseRequest) (*pb.ResponseStatus, error)
func (*Server) UpdateStatus ¶
Click to show internal directories.
Click to hide internal directories.