style: license headers + gofmt

This commit is contained in:
2024-03-27 11:12:43 +00:00
parent e9a1653c4e
commit 4d9a7a4856
109 changed files with 2059 additions and 530 deletions

View File

@@ -12,10 +12,10 @@ func PostToProto(post *internal.Post) *Post {
proto := Post{
Id: post.Id.GetReprId(),
PanelId: post.PanelId,
PanelId: post.PanelId,
AuthorId: post.AuthorId,
Title: post.Title,
Title: post.Title,
Content: post.Content,
CreatedAt: timestamppb.New(post.CreatedAt.Time),
@@ -36,12 +36,12 @@ func PostsToProto(posts []*internal.Post) []*Post {
protoPosts = append(protoPosts, PostToProto(post))
}
return protoPosts
}
}
// Protobuf 'PostMutable' -> PostCreate
func PostCreateFromProto(proto *PostMutable) internal.PostCreate {
return internal.PostCreate{
Title: proto.GetTitle(),
Title: proto.GetTitle(),
Content: proto.GetContent(),
}
}
@@ -49,7 +49,7 @@ func PostCreateFromProto(proto *PostMutable) internal.PostCreate {
// Protobuf 'PostMutable' -> PostUpdate
func PostUpdateFromProto(proto *PostMutable) internal.PostUpdate {
return internal.PostUpdate{
Title: proto.Title,
Title: proto.Title,
Content: proto.Content,
}
}
}

View File

@@ -1,6 +1,20 @@
// Copyright 2023 Declan Teevan
//
// 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.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc-gen-go v1.31.0
// protoc v4.23.4
// source: post.proto

View File

@@ -1,6 +1,20 @@
// Copyright 2023 Declan Teevan
//
// 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.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.23.4
// source: post.proto
@@ -19,6 +33,17 @@ import (
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
PostService_CreatePost_FullMethodName = "/panels.post.v1.PostService/CreatePost"
PostService_GetPost_FullMethodName = "/panels.post.v1.PostService/GetPost"
PostService_GetPanelPost_FullMethodName = "/panels.post.v1.PostService/GetPanelPost"
PostService_UpdatePost_FullMethodName = "/panels.post.v1.PostService/UpdatePost"
PostService_DeletePost_FullMethodName = "/panels.post.v1.PostService/DeletePost"
PostService_GetFeedPosts_FullMethodName = "/panels.post.v1.PostService/GetFeedPosts"
PostService_GetUserPosts_FullMethodName = "/panels.post.v1.PostService/GetUserPosts"
PostService_GetPanelPosts_FullMethodName = "/panels.post.v1.PostService/GetPanelPosts"
)
// PostServiceClient is the client API for PostService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
@@ -43,7 +68,7 @@ func NewPostServiceClient(cc grpc.ClientConnInterface) PostServiceClient {
func (c *postServiceClient) CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*Post, error) {
out := new(Post)
err := c.cc.Invoke(ctx, "/panels.post.v1.PostService/CreatePost", in, out, opts...)
err := c.cc.Invoke(ctx, PostService_CreatePost_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -52,7 +77,7 @@ func (c *postServiceClient) CreatePost(ctx context.Context, in *CreatePostReques
func (c *postServiceClient) GetPost(ctx context.Context, in *GetPostRequest, opts ...grpc.CallOption) (*Post, error) {
out := new(Post)
err := c.cc.Invoke(ctx, "/panels.post.v1.PostService/GetPost", in, out, opts...)
err := c.cc.Invoke(ctx, PostService_GetPost_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -61,7 +86,7 @@ func (c *postServiceClient) GetPost(ctx context.Context, in *GetPostRequest, opt
func (c *postServiceClient) GetPanelPost(ctx context.Context, in *GetPanelPostRequest, opts ...grpc.CallOption) (*Post, error) {
out := new(Post)
err := c.cc.Invoke(ctx, "/panels.post.v1.PostService/GetPanelPost", in, out, opts...)
err := c.cc.Invoke(ctx, PostService_GetPanelPost_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -70,7 +95,7 @@ func (c *postServiceClient) GetPanelPost(ctx context.Context, in *GetPanelPostRe
func (c *postServiceClient) UpdatePost(ctx context.Context, in *UpdatePostRequest, opts ...grpc.CallOption) (*Post, error) {
out := new(Post)
err := c.cc.Invoke(ctx, "/panels.post.v1.PostService/UpdatePost", in, out, opts...)
err := c.cc.Invoke(ctx, PostService_UpdatePost_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -79,7 +104,7 @@ func (c *postServiceClient) UpdatePost(ctx context.Context, in *UpdatePostReques
func (c *postServiceClient) DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/panels.post.v1.PostService/DeletePost", in, out, opts...)
err := c.cc.Invoke(ctx, PostService_DeletePost_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -88,7 +113,7 @@ func (c *postServiceClient) DeletePost(ctx context.Context, in *DeletePostReques
func (c *postServiceClient) GetFeedPosts(ctx context.Context, in *GetFeedPostsRequest, opts ...grpc.CallOption) (*FeedPosts, error) {
out := new(FeedPosts)
err := c.cc.Invoke(ctx, "/panels.post.v1.PostService/GetFeedPosts", in, out, opts...)
err := c.cc.Invoke(ctx, PostService_GetFeedPosts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -97,7 +122,7 @@ func (c *postServiceClient) GetFeedPosts(ctx context.Context, in *GetFeedPostsRe
func (c *postServiceClient) GetUserPosts(ctx context.Context, in *GetUserPostsRequest, opts ...grpc.CallOption) (*UserPosts, error) {
out := new(UserPosts)
err := c.cc.Invoke(ctx, "/panels.post.v1.PostService/GetUserPosts", in, out, opts...)
err := c.cc.Invoke(ctx, PostService_GetUserPosts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -106,7 +131,7 @@ func (c *postServiceClient) GetUserPosts(ctx context.Context, in *GetUserPostsRe
func (c *postServiceClient) GetPanelPosts(ctx context.Context, in *GetPanelPostsRequest, opts ...grpc.CallOption) (*PanelPosts, error) {
out := new(PanelPosts)
err := c.cc.Invoke(ctx, "/panels.post.v1.PostService/GetPanelPosts", in, out, opts...)
err := c.cc.Invoke(ctx, PostService_GetPanelPosts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -179,7 +204,7 @@ func _PostService_CreatePost_Handler(srv interface{}, ctx context.Context, dec f
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/panels.post.v1.PostService/CreatePost",
FullMethod: PostService_CreatePost_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PostServiceServer).CreatePost(ctx, req.(*CreatePostRequest))
@@ -197,7 +222,7 @@ func _PostService_GetPost_Handler(srv interface{}, ctx context.Context, dec func
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/panels.post.v1.PostService/GetPost",
FullMethod: PostService_GetPost_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PostServiceServer).GetPost(ctx, req.(*GetPostRequest))
@@ -215,7 +240,7 @@ func _PostService_GetPanelPost_Handler(srv interface{}, ctx context.Context, dec
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/panels.post.v1.PostService/GetPanelPost",
FullMethod: PostService_GetPanelPost_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PostServiceServer).GetPanelPost(ctx, req.(*GetPanelPostRequest))
@@ -233,7 +258,7 @@ func _PostService_UpdatePost_Handler(srv interface{}, ctx context.Context, dec f
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/panels.post.v1.PostService/UpdatePost",
FullMethod: PostService_UpdatePost_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PostServiceServer).UpdatePost(ctx, req.(*UpdatePostRequest))
@@ -251,7 +276,7 @@ func _PostService_DeletePost_Handler(srv interface{}, ctx context.Context, dec f
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/panels.post.v1.PostService/DeletePost",
FullMethod: PostService_DeletePost_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PostServiceServer).DeletePost(ctx, req.(*DeletePostRequest))
@@ -269,7 +294,7 @@ func _PostService_GetFeedPosts_Handler(srv interface{}, ctx context.Context, dec
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/panels.post.v1.PostService/GetFeedPosts",
FullMethod: PostService_GetFeedPosts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PostServiceServer).GetFeedPosts(ctx, req.(*GetFeedPostsRequest))
@@ -287,7 +312,7 @@ func _PostService_GetUserPosts_Handler(srv interface{}, ctx context.Context, dec
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/panels.post.v1.PostService/GetUserPosts",
FullMethod: PostService_GetUserPosts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PostServiceServer).GetUserPosts(ctx, req.(*GetUserPostsRequest))
@@ -305,7 +330,7 @@ func _PostService_GetPanelPosts_Handler(srv interface{}, ctx context.Context, de
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/panels.post.v1.PostService/GetPanelPosts",
FullMethod: PostService_GetPanelPosts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PostServiceServer).GetPanelPosts(ctx, req.(*GetPanelPostsRequest))