diff --git a/internal/dao/cache/bigcache.go b/internal/dao/cache/bigcache.go index 1fb5130f..5a9f779b 100644 --- a/internal/dao/cache/bigcache.go +++ b/internal/dao/cache/bigcache.go @@ -9,8 +9,6 @@ import ( "github.com/allegro/bigcache/v3" ) -var _ tweetsCache = (*bigCacheTweetsCache)(nil) - type bigCacheTweetsCache struct { bc *bigcache.BigCache } diff --git a/internal/dao/cache/constraint.go b/internal/dao/cache/constraint.go new file mode 100644 index 00000000..bc42072c --- /dev/null +++ b/internal/dao/cache/constraint.go @@ -0,0 +1,20 @@ +//go:build constraint + +package cache + +import ( + "github.com/rocboss/paopao-ce/internal/core" +) + +var ( + _ tweetsCache = (*bigCacheTweetsCache)(nil) + + _ core.RedisCache = (*redisCache)(nil) + _ tweetsCache = (*redisCacheTweetsCache)(nil) + + _ core.CacheIndexService = (*noneCacheIndexServant)(nil) + _ core.VersionInfo = (*noneCacheIndexServant)(nil) + + _ core.CacheIndexService = (*simpleCacheIndexServant)(nil) + _ core.VersionInfo = (*simpleCacheIndexServant)(nil) +) diff --git a/internal/dao/cache/none.go b/internal/dao/cache/none.go index 079c453b..0b165ed6 100644 --- a/internal/dao/cache/none.go +++ b/internal/dao/cache/none.go @@ -12,11 +12,6 @@ import ( "github.com/rocboss/paopao-ce/pkg/debug" ) -var ( - _ core.CacheIndexService = (*noneCacheIndexServant)(nil) - _ core.VersionInfo = (*noneCacheIndexServant)(nil) -) - type noneCacheIndexServant struct { ips core.IndexPostsService } diff --git a/internal/dao/cache/redis.go b/internal/dao/cache/redis.go index 0e106c5a..8b466e8c 100644 --- a/internal/dao/cache/redis.go +++ b/internal/dao/cache/redis.go @@ -12,12 +12,6 @@ import ( "github.com/Masterminds/semver/v3" "github.com/redis/rueidis" - "github.com/rocboss/paopao-ce/internal/core" -) - -var ( - _ core.RedisCache = (*redisCache)(nil) - _ tweetsCache = (*redisCacheTweetsCache)(nil) ) const ( diff --git a/internal/dao/cache/simple.go b/internal/dao/cache/simple.go index a1c230d3..fb6ea951 100644 --- a/internal/dao/cache/simple.go +++ b/internal/dao/cache/simple.go @@ -16,11 +16,6 @@ import ( "github.com/sirupsen/logrus" ) -var ( - _ core.CacheIndexService = (*simpleCacheIndexServant)(nil) - _ core.VersionInfo = (*simpleCacheIndexServant)(nil) -) - type simpleCacheIndexServant struct { ips core.IndexPostsService diff --git a/internal/dao/jinzhu/constraint.go b/internal/dao/jinzhu/constraint.go new file mode 100644 index 00000000..eb65e121 --- /dev/null +++ b/internal/dao/jinzhu/constraint.go @@ -0,0 +1,13 @@ +//go:build constraint + +package jinzhu + +import "github.com/rocboss/paopao-ce/internal/core" + +var ( + _ core.DataService = (*dataSrv)(nil) + _ core.VersionInfo = (*dataSrv)(nil) + + _ core.WebDataServantA = (*webDataSrvA)(nil) + _ core.VersionInfo = (*webDataSrvA)(nil) +) diff --git a/internal/dao/jinzhu/jinzhu.go b/internal/dao/jinzhu/jinzhu.go index 16b6d64a..444cb141 100644 --- a/internal/dao/jinzhu/jinzhu.go +++ b/internal/dao/jinzhu/jinzhu.go @@ -18,15 +18,7 @@ import ( "github.com/rocboss/paopao-ce/internal/dao/security" ) -var ( - _ core.DataService = (*dataSrv)(nil) - _ core.VersionInfo = (*dataSrv)(nil) - - _ core.WebDataServantA = (*webDataSrvA)(nil) - _ core.VersionInfo = (*webDataSrvA)(nil) - - _onceInitial sync.Once -) +var _onceInitial sync.Once type dataSrv struct { core.WalletService diff --git a/internal/dao/search/bridge.go b/internal/dao/search/bridge.go index 43028c95..60b0f99a 100644 --- a/internal/dao/search/bridge.go +++ b/internal/dao/search/bridge.go @@ -12,8 +12,6 @@ import ( "github.com/sirupsen/logrus" ) -var _ core.TweetSearchService = (*bridgeTweetSearchServant)(nil) - type documents struct { primaryKey []string docItems []core.TsDocItem diff --git a/internal/dao/search/constraint.go b/internal/dao/search/constraint.go new file mode 100644 index 00000000..5af8ee94 --- /dev/null +++ b/internal/dao/search/constraint.go @@ -0,0 +1,15 @@ +//go:build constraint + +package search + +import "github.com/rocboss/paopao-ce/internal/core" + +var ( + _ core.TweetSearchService = (*bridgeTweetSearchServant)(nil) + + _ core.TweetSearchService = (*meiliTweetSearchServant)(nil) + _ core.VersionInfo = (*meiliTweetSearchServant)(nil) + + _ core.TweetSearchService = (*zincTweetSearchServant)(nil) + _ core.VersionInfo = (*zincTweetSearchServant)(nil) +) diff --git a/internal/dao/search/meili.go b/internal/dao/search/meili.go index 74391ef3..70bad1ca 100644 --- a/internal/dao/search/meili.go +++ b/internal/dao/search/meili.go @@ -16,11 +16,6 @@ import ( "github.com/sirupsen/logrus" ) -var ( - _ core.TweetSearchService = (*meiliTweetSearchServant)(nil) - _ core.VersionInfo = (*meiliTweetSearchServant)(nil) -) - type meiliTweetSearchServant struct { tweetSearchFilter diff --git a/internal/dao/search/zinc.go b/internal/dao/search/zinc.go index 91f74b42..4dd688c9 100644 --- a/internal/dao/search/zinc.go +++ b/internal/dao/search/zinc.go @@ -15,11 +15,6 @@ import ( "github.com/sirupsen/logrus" ) -var ( - _ core.TweetSearchService = (*zincTweetSearchServant)(nil) - _ core.VersionInfo = (*zincTweetSearchServant)(nil) -) - type zincTweetSearchServant struct { tweetSearchFilter diff --git a/internal/dao/security/attachment_check.go b/internal/dao/security/attachment_check.go index 591554e8..706621ac 100644 --- a/internal/dao/security/attachment_check.go +++ b/internal/dao/security/attachment_check.go @@ -12,8 +12,6 @@ import ( "github.com/rocboss/paopao-ce/internal/core" ) -var _ core.AttachmentCheckService = (*attachmentCheckServant)(nil) - type attachmentCheckServant struct { domain string } diff --git a/internal/dao/security/constraint.go b/internal/dao/security/constraint.go new file mode 100644 index 00000000..1172e157 --- /dev/null +++ b/internal/dao/security/constraint.go @@ -0,0 +1,12 @@ +//go:build constraint + +package security + +import ( + "github.com/rocboss/paopao-ce/internal/core" +) + +var ( + _ core.AttachmentCheckService = (*attachmentCheckServant)(nil) + _ core.PhoneVerifyService = (*juheSmsServant)(nil) +) diff --git a/internal/dao/security/phone_verify_juhe.go b/internal/dao/security/phone_verify_juhe.go index 25dfd553..efc246d4 100644 --- a/internal/dao/security/phone_verify_juhe.go +++ b/internal/dao/security/phone_verify_juhe.go @@ -7,13 +7,10 @@ import ( "github.com/cockroachdb/errors" "github.com/rocboss/paopao-ce/internal/conf" - "github.com/rocboss/paopao-ce/internal/core" "github.com/rocboss/paopao-ce/pkg/json" "gopkg.in/resty.v1" ) -var _ core.PhoneVerifyService = (*juheSmsServant)(nil) - type juhePhoneCaptchaRsp struct { ErrorCode int `json:"error_code"` Reason string `json:"reason"` diff --git a/internal/dao/storage/alioss.go b/internal/dao/storage/alioss.go index e72fa44c..3d6ead5f 100644 --- a/internal/dao/storage/alioss.go +++ b/internal/dao/storage/alioss.go @@ -16,14 +16,6 @@ import ( "github.com/sirupsen/logrus" ) -var ( - _ core.ObjectStorageService = (*aliossServant)(nil) - _ core.OssCreateService = (*aliossCreateServant)(nil) - _ core.OssCreateService = (*aliossCreateRetentionServant)(nil) - _ core.OssCreateService = (*aliossCreateTempDirServant)(nil) - _ core.VersionInfo = (*aliossServant)(nil) -) - type aliossCreateServant struct { bucket *oss.Bucket domain string diff --git a/internal/dao/storage/constraint.go b/internal/dao/storage/constraint.go new file mode 100644 index 00000000..416d2e36 --- /dev/null +++ b/internal/dao/storage/constraint.go @@ -0,0 +1,37 @@ +//go:build constraint + +package storage + +import ( + "github.com/rocboss/paopao-ce/internal/core" +) + +var ( + _ core.ObjectStorageService = (*aliossServant)(nil) + _ core.OssCreateService = (*aliossCreateServant)(nil) + _ core.OssCreateService = (*aliossCreateRetentionServant)(nil) + _ core.OssCreateService = (*aliossCreateTempDirServant)(nil) + _ core.VersionInfo = (*aliossServant)(nil) + + _ core.ObjectStorageService = (*cosServant)(nil) + _ core.OssCreateService = (*cosCreateServant)(nil) + _ core.OssCreateService = (*cosCreateTempDirServant)(nil) + _ core.VersionInfo = (*cosServant)(nil) + + _ core.ObjectStorageService = (*huaweiobsServant)(nil) + _ core.OssCreateService = (*hwobsCreateServant)(nil) + _ core.OssCreateService = (*hwobsCreateRetentionServant)(nil) + _ core.OssCreateService = (*hwobsCreateTempDirServant)(nil) + _ core.VersionInfo = (*huaweiobsServant)(nil) + + _ core.ObjectStorageService = (*localossServant)(nil) + _ core.OssCreateService = (*localossCreateServant)(nil) + _ core.OssCreateService = (*localossCreateTempDirServant)(nil) + _ core.VersionInfo = (*localossServant)(nil) + + _ core.ObjectStorageService = (*minioServant)(nil) + _ core.OssCreateService = (*minioCreateServant)(nil) + _ core.OssCreateService = (*minioCreateRetentionServant)(nil) + _ core.OssCreateService = (*minioCreateTempDirServant)(nil) + _ core.VersionInfo = (*minioServant)(nil) +) diff --git a/internal/dao/storage/cos.go b/internal/dao/storage/cos.go index bb2790f4..3582deec 100644 --- a/internal/dao/storage/cos.go +++ b/internal/dao/storage/cos.go @@ -19,13 +19,6 @@ import ( "github.com/tencentyun/cos-go-sdk-v5" ) -var ( - _ core.ObjectStorageService = (*cosServant)(nil) - _ core.OssCreateService = (*cosCreateServant)(nil) - _ core.OssCreateService = (*cosCreateTempDirServant)(nil) - _ core.VersionInfo = (*cosServant)(nil) -) - type cosCreateServant struct { client *cos.Client domain string diff --git a/internal/dao/storage/huaweiobs.go b/internal/dao/storage/huaweiobs.go index 7db9818b..ea225da4 100644 --- a/internal/dao/storage/huaweiobs.go +++ b/internal/dao/storage/huaweiobs.go @@ -15,14 +15,6 @@ import ( "github.com/sirupsen/logrus" ) -var ( - _ core.ObjectStorageService = (*huaweiobsServant)(nil) - _ core.OssCreateService = (*hwobsCreateServant)(nil) - _ core.OssCreateService = (*hwobsCreateRetentionServant)(nil) - _ core.OssCreateService = (*hwobsCreateTempDirServant)(nil) - _ core.VersionInfo = (*huaweiobsServant)(nil) -) - type hwobsCreateServant struct { client *obs.ObsClient bucket string diff --git a/internal/dao/storage/localoss.go b/internal/dao/storage/localoss.go index d110b371..6359a9fc 100644 --- a/internal/dao/storage/localoss.go +++ b/internal/dao/storage/localoss.go @@ -18,13 +18,6 @@ import ( "github.com/sirupsen/logrus" ) -var ( - _ core.ObjectStorageService = (*localossServant)(nil) - _ core.OssCreateService = (*localossCreateServant)(nil) - _ core.OssCreateService = (*localossCreateTempDirServant)(nil) - _ core.VersionInfo = (*localossServant)(nil) -) - type localossCreateServant struct { savePath string domain string diff --git a/internal/dao/storage/minio.go b/internal/dao/storage/minio.go index 028e331a..9220eda8 100644 --- a/internal/dao/storage/minio.go +++ b/internal/dao/storage/minio.go @@ -17,14 +17,6 @@ import ( "github.com/sirupsen/logrus" ) -var ( - _ core.ObjectStorageService = (*minioServant)(nil) - _ core.OssCreateService = (*minioCreateServant)(nil) - _ core.OssCreateService = (*minioCreateRetentionServant)(nil) - _ core.OssCreateService = (*minioCreateTempDirServant)(nil) - _ core.VersionInfo = (*minioServant)(nil) -) - type minioCreateServant struct { client *minio.Client bucket string diff --git a/internal/servants/admin/constraint.go b/internal/servants/admin/constraint.go new file mode 100644 index 00000000..24aa29b2 --- /dev/null +++ b/internal/servants/admin/constraint.go @@ -0,0 +1,9 @@ +//go:build constraint + +package admin + +import ( + api "github.com/rocboss/paopao-ce/auto/api/m/v1" +) + +var _ api.User = (*userSrv)(nil) diff --git a/internal/servants/admin/user.go b/internal/servants/admin/user.go index 1233e715..92679de4 100644 --- a/internal/servants/admin/user.go +++ b/internal/servants/admin/user.go @@ -9,8 +9,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants/base" ) -var _ api.User = (*userSrv)(nil) - type userSrv struct { *base.BaseServant api.UnimplementedUserServant diff --git a/internal/servants/bot/constraint.go b/internal/servants/bot/constraint.go new file mode 100644 index 00000000..e0306280 --- /dev/null +++ b/internal/servants/bot/constraint.go @@ -0,0 +1,9 @@ +//go:build constraint + +package bot + +import ( + api "github.com/rocboss/paopao-ce/auto/api/r/v1" +) + +var _ api.User = (*userSrv)(nil) diff --git a/internal/servants/bot/user.go b/internal/servants/bot/user.go index 714f299b..80d10387 100644 --- a/internal/servants/bot/user.go +++ b/internal/servants/bot/user.go @@ -9,8 +9,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants/base" ) -var _ api.User = (*userSrv)(nil) - type userSrv struct { *base.BaseServant api.UnimplementedUserServant diff --git a/internal/servants/localoss/constraint.go b/internal/servants/localoss/constraint.go new file mode 100644 index 00000000..e955aa14 --- /dev/null +++ b/internal/servants/localoss/constraint.go @@ -0,0 +1,9 @@ +//go:build constraint + +package localoss + +import ( + api "github.com/rocboss/paopao-ce/auto/api/s/v1" +) + +var _ api.User = (*userSrv)(nil) diff --git a/internal/servants/localoss/user.go b/internal/servants/localoss/user.go index d0cfe93e..167f38f9 100644 --- a/internal/servants/localoss/user.go +++ b/internal/servants/localoss/user.go @@ -9,8 +9,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants/base" ) -var _ api.User = (*userSrv)(nil) - type userSrv struct { *base.BaseServant api.UnimplementedUserServant diff --git a/internal/servants/mobile/constraint.go b/internal/servants/mobile/constraint.go new file mode 100644 index 00000000..5cf9a2fd --- /dev/null +++ b/internal/servants/mobile/constraint.go @@ -0,0 +1,9 @@ +//go:build constraint + +package mobile + +import ( + api "github.com/rocboss/paopao-ce/auto/rpc/greet/v1" +) + +var _ api.GreetServiceServer = (*greetServiceSrv)(nil) diff --git a/internal/servants/mobile/greet.go b/internal/servants/mobile/greet.go index 0e5a1f10..3fd30653 100644 --- a/internal/servants/mobile/greet.go +++ b/internal/servants/mobile/greet.go @@ -8,8 +8,6 @@ import ( api "github.com/rocboss/paopao-ce/auto/rpc/greet/v1" ) -var _ api.GreetServiceServer = (*greetServiceSrv)(nil) - type greetServiceSrv struct { api.UnimplementedGreetServiceServer } diff --git a/internal/servants/space/constraint.go b/internal/servants/space/constraint.go new file mode 100644 index 00000000..a0e26dc6 --- /dev/null +++ b/internal/servants/space/constraint.go @@ -0,0 +1,9 @@ +//go:build constraint + +package space + +import ( + api "github.com/rocboss/paopao-ce/auto/api/x/v1" +) + +var _ api.User = (*userSrv)(nil) diff --git a/internal/servants/space/user.go b/internal/servants/space/user.go index c83b98d1..f2075530 100644 --- a/internal/servants/space/user.go +++ b/internal/servants/space/user.go @@ -9,8 +9,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants/base" ) -var _ api.User = (*userSrv)(nil) - type userSrv struct { *base.BaseServant api.UnimplementedUserServant diff --git a/internal/servants/web/admin.go b/internal/servants/web/admin.go index f38d4aaf..0b393cba 100644 --- a/internal/servants/web/admin.go +++ b/internal/servants/web/admin.go @@ -18,8 +18,6 @@ import ( "github.com/sirupsen/logrus" ) -var _ api.Admin = (*adminSrv)(nil) - type adminSrv struct { api.UnimplementedAdminServant *base.DaoServant diff --git a/internal/servants/web/alipay.go b/internal/servants/web/alipay.go index 1fed1408..3734d2d9 100644 --- a/internal/servants/web/alipay.go +++ b/internal/servants/web/alipay.go @@ -16,11 +16,6 @@ import ( "github.com/smartwalle/alipay/v3" ) -var ( - _ api.AlipayPub = (*alipayPubSrv)(nil) - _ api.AlipayPriv = (*alipayPrivSrv)(nil) -) - type alipayPubSrv struct { api.UnimplementedAlipayPubServant *base.DaoServant diff --git a/internal/servants/web/constraint.go b/internal/servants/web/constraint.go new file mode 100644 index 00000000..cd46137b --- /dev/null +++ b/internal/servants/web/constraint.go @@ -0,0 +1,23 @@ +//go:build constraint + +package web + +import ( + api "github.com/rocboss/paopao-ce/auto/api/v1" +) + +var ( + _ api.Admin = (*adminSrv)(nil) + _ api.AlipayPub = (*alipayPubSrv)(nil) + _ api.AlipayPriv = (*alipayPrivSrv)(nil) + _ api.Core = (*coreSrv)(nil) + _ api.Followship = (*followshipSrv)(nil) + _ api.Friendship = (*friendshipSrv)(nil) + _ api.Loose = (*looseSrv)(nil) + _ api.Pub = (*pubSrv)(nil) + _ api.Relax = (*relaxSrv)(nil) + _ api.Site = (*siteSrv)(nil) + _ api.Trends = (*trendsSrv)(nil) + _ api.Priv = (*privSrv)(nil) + _ api.PrivChain = (*privChain)(nil) +) diff --git a/internal/servants/web/core.go b/internal/servants/web/core.go index d0fbeb79..677db40a 100644 --- a/internal/servants/web/core.go +++ b/internal/servants/web/core.go @@ -29,8 +29,6 @@ var ( _maxCaptchaTimes int = 2 ) -var _ api.Core = (*coreSrv)(nil) - type coreSrv struct { api.UnimplementedCoreServant *base.DaoServant diff --git a/internal/servants/web/followship.go b/internal/servants/web/followship.go index bd9caf34..75dc930b 100644 --- a/internal/servants/web/followship.go +++ b/internal/servants/web/followship.go @@ -15,8 +15,6 @@ import ( "github.com/sirupsen/logrus" ) -var _ api.Followship = (*followshipSrv)(nil) - type followshipSrv struct { api.UnimplementedFollowshipServant *base.DaoServant diff --git a/internal/servants/web/friendship.go b/internal/servants/web/friendship.go index 1851fc21..977250e5 100644 --- a/internal/servants/web/friendship.go +++ b/internal/servants/web/friendship.go @@ -14,8 +14,6 @@ import ( "github.com/sirupsen/logrus" ) -var _ api.Friendship = (*friendshipSrv)(nil) - type friendshipSrv struct { api.UnimplementedFriendshipServant *base.DaoServant diff --git a/internal/servants/web/loose.go b/internal/servants/web/loose.go index 66f9335d..5d484c3e 100644 --- a/internal/servants/web/loose.go +++ b/internal/servants/web/loose.go @@ -21,8 +21,6 @@ import ( "github.com/sirupsen/logrus" ) -var _ api.Loose = (*looseSrv)(nil) - type looseSrv struct { api.UnimplementedLooseServant *base.DaoServant diff --git a/internal/servants/web/priv.go b/internal/servants/web/priv.go index 9835bf24..50d6f338 100644 --- a/internal/servants/web/priv.go +++ b/internal/servants/web/priv.go @@ -27,17 +27,12 @@ import ( "github.com/sirupsen/logrus" ) -var ( - _ api.Priv = (*privSrv)(nil) - _ api.PrivChain = (*privChain)(nil) - - _uploadAttachmentTypeMap = map[string]ms.AttachmentType{ - "public/image": ms.AttachmentTypeImage, - "public/avatar": ms.AttachmentTypeImage, - "public/video": ms.AttachmentTypeVideo, - "attachment": ms.AttachmentTypeOther, - } -) +var _uploadAttachmentTypeMap = map[string]ms.AttachmentType{ + "public/image": ms.AttachmentTypeImage, + "public/avatar": ms.AttachmentTypeImage, + "public/video": ms.AttachmentTypeVideo, + "attachment": ms.AttachmentTypeOther, +} type privSrv struct { api.UnimplementedPrivServant diff --git a/internal/servants/web/pub.go b/internal/servants/web/pub.go index 59bbff04..377ab832 100644 --- a/internal/servants/web/pub.go +++ b/internal/servants/web/pub.go @@ -27,8 +27,6 @@ import ( "github.com/sirupsen/logrus" ) -var _ api.Pub = (*pubSrv)(nil) - const ( _MaxLoginErrTimes = 10 _MaxPhoneCaptcha = 10 diff --git a/internal/servants/web/relax.go b/internal/servants/web/relax.go index 468c033c..869ef4e6 100644 --- a/internal/servants/web/relax.go +++ b/internal/servants/web/relax.go @@ -15,8 +15,6 @@ import ( "github.com/sirupsen/logrus" ) -var _ api.Relax = (*relaxSrv)(nil) - type relaxSrv struct { api.UnimplementedRelaxServant *base.DaoServant diff --git a/internal/servants/web/site.go b/internal/servants/web/site.go index 54636afa..262c1336 100644 --- a/internal/servants/web/site.go +++ b/internal/servants/web/site.go @@ -12,8 +12,6 @@ import ( "github.com/rocboss/paopao-ce/pkg/version" ) -var _ api.Site = (*siteSrv)(nil) - type siteSrv struct { api.UnimplementedSiteServant *base.BaseServant diff --git a/internal/servants/web/trends.go b/internal/servants/web/trends.go index bf04fd1a..d44f84a0 100644 --- a/internal/servants/web/trends.go +++ b/internal/servants/web/trends.go @@ -18,8 +18,6 @@ import ( "github.com/sirupsen/logrus" ) -var _ api.Trends = (*trendsSrv)(nil) - type trendsSrv struct { api.UnimplementedTrendsServant *base.DaoServant diff --git a/internal/service/admin.go b/internal/service/admin.go index 47ac6659..22ca066d 100644 --- a/internal/service/admin.go +++ b/internal/service/admin.go @@ -16,8 +16,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants" ) -var _ Service = (*adminService)(nil) - type adminService struct { *baseHttpService } diff --git a/internal/service/bot.go b/internal/service/bot.go index 62d245e6..cf4b85ed 100644 --- a/internal/service/bot.go +++ b/internal/service/bot.go @@ -16,8 +16,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants" ) -var _ Service = (*botService)(nil) - type botService struct { *baseHttpService } diff --git a/internal/service/constraint.go b/internal/service/constraint.go new file mode 100644 index 00000000..eada6001 --- /dev/null +++ b/internal/service/constraint.go @@ -0,0 +1,18 @@ +//go:build constraint + +package service + +var ( + _ server = (*grpcServer)(nil) + _ server = (*httpServer)(nil) + + _ Service = (*adminService)(nil) + _ Service = (*botService)(nil) + _ Service = (*frontendWebService)(nil) + _ Service = (*localossService)(nil) + _ Service = (*metricsService)(nil) + _ Service = (*pprofService)(nil) + _ Service = (*mobileService)(nil) + _ Service = (*spaceXService)(nil) + _ Service = (*webService)(nil) +) diff --git a/internal/service/frontend_web.go b/internal/service/frontend_web.go index 7873c8a5..4e9bd181 100644 --- a/internal/service/frontend_web.go +++ b/internal/service/frontend_web.go @@ -14,8 +14,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants" ) -var _ Service = (*frontendWebService)(nil) - type frontendWebService struct { *baseHttpService } diff --git a/internal/service/grpc_server.go b/internal/service/grpc_server.go index 23d92da5..837c6932 100644 --- a/internal/service/grpc_server.go +++ b/internal/service/grpc_server.go @@ -10,8 +10,6 @@ import ( "google.golang.org/grpc" ) -var _ server = (*grpcServer)(nil) - // grpcServer wraper for grpc.Server type grpcServer struct { *baseServer diff --git a/internal/service/http_server.go b/internal/service/http_server.go index f34eef2a..ebbaeeb9 100644 --- a/internal/service/http_server.go +++ b/internal/service/http_server.go @@ -11,8 +11,6 @@ import ( "github.com/gin-gonic/gin" ) -var _ server = (*httpServer)(nil) - // httpServer wraper for gin.engine and http.Server type httpServer struct { *baseServer diff --git a/internal/service/localoss.go b/internal/service/localoss.go index b0789acc..43d14e34 100644 --- a/internal/service/localoss.go +++ b/internal/service/localoss.go @@ -15,8 +15,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants" ) -var _ Service = (*localossService)(nil) - type localossService struct { *baseHttpService } diff --git a/internal/service/metrics.go b/internal/service/metrics.go index fb81bfb6..0dffeba0 100644 --- a/internal/service/metrics.go +++ b/internal/service/metrics.go @@ -17,8 +17,6 @@ import ( "github.com/rocboss/paopao-ce/internal/infra/metrics/statistics" ) -var _ Service = (*metricsService)(nil) - type metricsService struct { *baseHttpService } diff --git a/internal/service/mobile.go b/internal/service/mobile.go index 8b74b06f..48186ec4 100644 --- a/internal/service/mobile.go +++ b/internal/service/mobile.go @@ -16,8 +16,6 @@ import ( "google.golang.org/grpc" ) -var _ Service = (*mobileService)(nil) - type mobileService struct { *baseGRPCService } diff --git a/internal/service/pprof.go b/internal/service/pprof.go index 731c70c1..12706557 100644 --- a/internal/service/pprof.go +++ b/internal/service/pprof.go @@ -13,8 +13,6 @@ import ( "github.com/rocboss/paopao-ce/internal/conf" ) -var _ Service = (*pprofService)(nil) - type pprofService struct { *baseHttpService } diff --git a/internal/service/space.go b/internal/service/space.go index f4c7ae0b..b8bf524f 100644 --- a/internal/service/space.go +++ b/internal/service/space.go @@ -16,8 +16,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants" ) -var _ Service = (*spaceXService)(nil) - type spaceXService struct { *baseHttpService } diff --git a/internal/service/web.go b/internal/service/web.go index 3c1ec97e..9cea8e1f 100644 --- a/internal/service/web.go +++ b/internal/service/web.go @@ -17,8 +17,6 @@ import ( "github.com/rocboss/paopao-ce/internal/servants" ) -var _ Service = (*webService)(nil) - type webService struct { *baseHttpService }