
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
github.com/CorrectRoadH/likit-go
Advanced tools
likit-go is a Client library for the Likit in Golang.
go get github.com/likit/likit-go
A Comment Like Example
import (
"github.com/CorrectRoadH/likit-go"
)
type CommentServer struct {
Store *store.CommentStore
likitServer *likit.LikitServer
}
func NewCommentServer(store *store.CommentStore) *CommentServer {
return &CommentServer{
Store: store,
// the likit server address. You should replace it with your own server address
// likit.NewlikitServer("localhost:4778",false),
likitServer: likit.NewlikitServer("likit.zeabur.app:443",true),
// NewlikitServer(host string, tls bool)
// if you deploy likit server in zeabur. tls shoud be true
}
}
const businessId = "COMMENT_LIKE"
// get comment
func (s *CommentServer) ListComment(c echo.Context) error {
userId := /// get user id from jwt or cookie
// define find condition
find := ////
comments, err := s.Store.ListComment(ctx, find)
return c.JSON(http.StatusOK, lo.Map(comments, func(comment types.Comment, index int) Comment {
isLike, err := s.likitServer.IsVote(ctx, businessId, comment.Id, comment.UserId)
if err != nil {
// handle error
}
likeNum, err := s.likitServer.Count(ctx, businessId, comment.Id)
if err != nil {
// handle err
}
return convertComment(comment, isLike, likeNum)
}))
}
func (s *CommentServer) Like(c echo.Context) (*apiv1pb.LikeResponse, error) {
userId := /// get user id from jwt or cookie
commentId := /// get comment id from request
count, err := s.likitServer.Vote(ctx, businessId, commentId, UserId)
if err != nil {
// handle error
}
return c.JSON(http.StatusOK, Count: count)
}
func (s *CommentServer) Unlike(c echo.Context) (*apiv1pb.LikeResponse, error) {
userId := /// get user id from jwt or cookie
commentId := /// get comment id from request
count, err := s.likitServer.UnVote(ctx, businessId, commentId, UserId)
if err != nil {
// handle error
}
return c.JSON(http.StatusOK, Count: count)
}
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.