repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/mocks/eth.mock.go
mocks/eth.mock.go
// Code generated by counterfeiter. DO NOT EDIT. package mocks import ( "context" "sync" "github.com/RTradeLtd/grpc/pay" "github.com/RTradeLtd/grpc/pay/request" "github.com/RTradeLtd/grpc/pay/response" "google.golang.org/grpc" ) type FakeSignerClient struct { GetSignedMessageStub func(context.Context, ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/mocks/orchestrator.mock.go
mocks/orchestrator.mock.go
// Code generated by counterfeiter. DO NOT EDIT. package mocks import ( "context" "sync" "github.com/RTradeLtd/grpc/nexus" "google.golang.org/grpc" ) type FakeServiceClient struct { NetworkDiagnosticsStub func(context.Context, *nexus.NetworkRequest, ...grpc.CallOption) (*nexus.NetworkDiagnosticsResponse,...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/grpc-clients/lens.go
grpc-clients/lens.go
package clients import ( "fmt" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/grpc/dialer" pb "github.com/RTradeLtd/grpc/lensv2" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) const ( defaultURL = "127.0.0.1:9998" ) // LensClient is a lens client used to make requests to the Lens gRP...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/grpc-clients/bch.go
grpc-clients/bch.go
package clients import ( "fmt" "github.com/RTradeLtd/config/v2" pb "github.com/gcash/bchwallet/rpc/walletrpc" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) // BchWalletClient provides a gRPC API // to manage a BCH wallet type BchWalletClient struct { pb.WalletServiceClient conn *grpc.ClientC...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/grpc-clients/orchestrator.go
grpc-clients/orchestrator.go
package clients import ( "fmt" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/grpc/dialer" nexus "github.com/RTradeLtd/grpc/nexus" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) // IPFSOrchestratorClient is a lighweight container for the orchestrator's // gRPC API client type IPFSOrche...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/grpc-clients/clients_test.go
grpc-clients/clients_test.go
package clients_test import ( "testing" clients "github.com/RTradeLtd/Temporal/grpc-clients" "github.com/RTradeLtd/config/v2" ) const ( testCfgPath = "../testenv/config.json" ) func TestLensClient_Fail(t *testing.T) { cfg, err := config.LoadConfig(testCfgPath) if err != nil { t.Fatal(err) } cfg.Services.L...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/grpc-clients/eth.go
grpc-clients/eth.go
package clients import ( "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/grpc/dialer" pb "github.com/RTradeLtd/grpc/pay" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) const ( defaultSignerURL = "127.0.0.1:9090" ) // SignerClient is how we interface with the Signer server as a client ty...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/grpc-clients/doc.go
grpc-clients/doc.go
// Package clients provides GRPC client constructors for various RTrade services // that Temporal relies on. package clients
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/mail/mail_test.go
mail/mail_test.go
package mail_test import ( "fmt" "os" "testing" "github.com/RTradeLtd/Temporal/mail" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2" ) var ( testRecipientEmail1 = "postables+test1@rtradetechnologies.com" testRecipientEmail2 = "postables+test2@rtradetechnologies.com" testRecipientName1 =...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/mail/mail.go
mail/mail.go
package mail import ( "errors" "sync" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2/models" "github.com/jinzhu/gorm" "github.com/sendgrid/rest" sendgrid "github.com/sendgrid/sendgrid-go" "github.com/sendgrid/sendgrid-go/helpers/mail" ) // Mailer is a class that handles mail delivery type...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/mail/doc.go
mail/doc.go
// Package mail provides Temporal's email utilities package mail
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/random_test.go
utils/random_test.go
package utils_test import ( "testing" "github.com/RTradeLtd/Temporal/utils" ) const ( letterBytesLower = "abcdefghijklmnopqrstuvwxyz" letterBytesLowerUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" letterBytesMixed = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPRQRSTUVWXYZ" ) func TestRandomUtils(t *testing.T) { ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/time.go
utils/time.go
package utils import "time" // CalculateGarbageCollectDate is used to calculate the date at which data is removed from our system func CalculateGarbageCollectDate(holdTimeInMonths int) time.Time { return time.Now().AddDate(0, holdTimeInMonths, 0) }
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/time_test.go
utils/time_test.go
package utils_test import ( "testing" "time" "github.com/RTradeLtd/Temporal/utils" ) func TestCalculateGarbageCollectDate(t *testing.T) { esimatedTime := utils.CalculateGarbageCollectDate(5) if esimatedTime == time.Now() { t.Fatal("invalid time retrieved") } }
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/cmc.go
utils/cmc.go
package utils import ( "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "net/url" "sync" "time" ) var ( tickerURL = "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest" pricer *priceChecker ) type coinPrice struct { price float64 nextRefresh time.Time } type priceChecker stru...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/multiaddr_validator.go
utils/multiaddr_validator.go
package utils import ( au "github.com/ipfs/go-ipfs-addr" ma "github.com/multiformats/go-multiaddr" ) /* Utilities that allow the user to validate multiaddr formatted addresses */ // GenerateMultiAddrFromString is used to take a string, and convert it to a multiformat based address func GenerateMultiAddrFromString(...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/utils.go
utils/utils.go
package utils import ( "math/big" "github.com/RTradeLtd/database/v2/models" "github.com/RTradeLtd/rtfs/v2" "github.com/c2h5oh/datasize" ) // CalculatePinCost is used to calculate the cost of pining a particular content hash // it returns the cost to bill the user, as well as the calculated size of the pin func C...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/cmc_test.go
utils/cmc_test.go
package utils_test import ( "os" "testing" "github.com/RTradeLtd/Temporal/utils" ) func TestRetrieveUsdPrice(t *testing.T) { type args struct { coin string } tests := []struct { name string args args wantErr bool }{ {"Ethereum", args{"ethereum"}, false}, {"Monero", args{"monero"}, false}, ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/utils_test.go
utils/utils_test.go
package utils_test import ( "testing" "time" "github.com/RTradeLtd/Temporal/utils" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2" "github.com/RTradeLtd/database/v2/models" "github.com/RTradeLtd/rtfs/v2" "github.com/jinzhu/gorm" ) const ( testHash = "QmS4ustL54uo8FzR9455qaxZwuMiUhy...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/ma_test.go
utils/ma_test.go
package utils_test import ( "testing" "github.com/RTradeLtd/Temporal/utils" ) var testIpfsMultiAddrString = "/ip4/192.168.1.242/tcp/4001/ipfs/QmXivHtDyAe8nS7cbQiS7ri9haUM2wGvbinjKws3a4EstT" var testP2PMultiAddrString = "/ip4/192.168.1.242/tcp/4001/p2p/QmXivHtDyAe8nS7cbQiS7ri9haUM2wGvbinjKws3a4EstT" var testInvalid...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/doc.go
utils/doc.go
// Package utils provides miscellaneous helpers and utilities package utils
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/utils/random.go
utils/random.go
package utils import ( "math/rand" "time" ) /* collection of random generating functions Taken from https://www.calhoun.io/creating-random-strings-in-go/ */ const ( // LetterBytes are the letters of an alphabet used to generate a random number LetterBytes = "abcdefghijklmnopqrstuvwxyz" ) // RandomUtils is our h...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/middleware/cors.go
api/middleware/cors.go
package middleware import ( "github.com/gin-gonic/gin" rscors "github.com/rs/cors/wrapper/gin" ) var ( // DefaultAllowedOrigins are the default allowed origins for the api, allowing for access // via both of our internet uplinks when using the web interface. DefaultAllowedOrigins = []string{"https://temporal.clo...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/middleware/middleware_test.go
api/middleware/middleware_test.go
package middleware import ( "net/http" "net/http/httptest" "reflect" "testing" "go.uber.org/zap/zaptest" "github.com/gin-gonic/gin" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2" ) func TestRequestIDMiddleware(t *testing.T) { testRecorder := httptest.NewRecorder() _, engine := gin.Cr...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/middleware/jwt.go
api/middleware/jwt.go
package middleware import ( "time" "github.com/RTradeLtd/database/v2/models" jwt "github.com/appleboy/gin-jwt" "github.com/gin-gonic/gin" "github.com/jinzhu/gorm" "go.uber.org/zap" ) // Login is used to unmarshal a login in request so that we can parse it type Login struct { Username string `form:"username" j...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/middleware/requestid.go
api/middleware/requestid.go
package middleware import ( "github.com/gin-gonic/gin" "github.com/google/uuid" ) // RequestID is used to insert a randomly generated // uuid as a value to a X-Request-ID header func RequestID() gin.HandlerFunc { return func(c *gin.Context) { c.Header("X-Request-Id", uuid.New().String()) c.Next() } }
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/middleware/security.go
api/middleware/security.go
package middleware import ( "github.com/gin-contrib/secure" "github.com/gin-gonic/gin" ) // NewSecWare is used to initialize our security middleware func NewSecWare(devMode bool) gin.HandlerFunc { config := secure.DefaultConfig() config.IsDevelopment = devMode config.ContentSecurityPolicy = "default-src 'self' h...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/middleware/doc.go
api/middleware/doc.go
// Package middleware provides the middleware used by Temporal's APIs package middleware
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_organizations_test.go
api/v2/routes_organizations_test.go
package v2 import ( "fmt" "io/ioutil" "net/http" "net/http/httptest" "net/url" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2/models" ) func Test_API_Routes_Organization(t *testing.T) { // load configuration cfg, err := config.LoadConfig(...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_ipns.go
api/v2/routes_ipns.go
package v2 import ( "fmt" "net/http" "strconv" "strings" "time" "github.com/gin-gonic/gin" path "github.com/ipfs/go-path" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/Temporal/utils" "github.com/RTradeLtd/database/v2/models" gocid "github.com/ipfs/go-cid"...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/rtfsp_management_test.go
api/v2/rtfsp_management_test.go
package v2 import ( "net/url" "testing" "github.com/RTradeLtd/database/v2/models" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" ) func Test_API_Routes_IPFS_Private_User_Management(t *testing.T) { // load configuration cfg, err := config.LoadConfig("../../testenv/config.json") if err...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_rtfsp_management.go
api/v2/routes_rtfsp_management.go
package v2 import ( "errors" "net/http" "strings" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/database/v2/models" nexus "github.com/RTradeLtd/grpc/nexus" "github.com/gin-gonic/gin" ) // these API calls are used to handle management of private IPFS networks // CreateIPFSNetwork is used to create ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_payment_test.go
api/v2/routes_payment_test.go
package v2 import ( "net/http/httptest" "net/url" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" ) func Test_API_Routes_Payments(t *testing.T) { // load configuration cfg, err := config.LoadConfig("../../testenv/config.json") if err != nil { t.Fatal(err) } db, err := loa...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_frontend.go
api/v2/routes_frontend.go
package v2 import ( "net/http" "strconv" "github.com/jinzhu/gorm" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/Temporal/utils" "github.com/RTradeLtd/database/v2/models" "github.com/gin-gonic/gin" gocid "github.com/ipfs/go-cid" ) // CalculatePinCost is used to calculate the cost of pinning someth...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/stats.go
api/v2/stats.go
package v2 import ( "net/http" "github.com/RTradeLtd/Temporal/eh" "github.com/gin-gonic/gin" stats "github.com/semihalev/gin-stats" ) func (api *API) getStats(c *gin.Context) { username, err := GetAuthenticatedUserFromContext(c) if err != nil { api.LogError(c, err, eh.NoAPITokenError)(http.StatusBadRequest) ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_organizations.go
api/v2/routes_organizations.go
package v2 import ( "bytes" "errors" "html" "net/http" "strconv" "strings" "time" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/database/v2/models" gpaginator "github.com/RTradeLtd/gpaginator" "github.com/gin-gonic/gin" "github.com/jszwec/csvutil" ) // creates a new organization func (api *API...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/api.go
api/v2/api.go
package v2 import ( "context" "crypto/tls" "fmt" "net/http" "os" "strconv" "time" "github.com/RTradeLtd/ChainRider-Go/dash" "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/Temporal/rtfscluster" pbLens "github.com/RTradeLtd/grpc/lensv2" pbOrch "github.com/RTradeLtd/grpc/nexus" pbSigner "github...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_payment.go
api/v2/routes_payment.go
package v2 import ( "context" "errors" "fmt" "net/http" "strconv" "github.com/gcash/bchutil" "github.com/stripe/stripe-go/charge" "github.com/RTradeLtd/Temporal/eh" "github.com/jinzhu/gorm" "github.com/stripe/stripe-go" "github.com/RTradeLtd/ChainRider-Go/dash" "github.com/RTradeLtd/Temporal/queue" "g...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/log_test.go
api/v2/log_test.go
package v2 import ( "encoding/json" "errors" "io/ioutil" "net/http" "net/http/httptest" "strings" "testing" "go.uber.org/zap" "go.uber.org/zap/zaptest/observer" "github.com/gin-gonic/gin" ) func TestAPI_LogError(t *testing.T) { type args struct { err error message string fields []interface{} ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_ipns_test.go
api/v2/routes_ipns_test.go
package v2 import ( "net/url" "testing" "time" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2/models" shell "github.com/RTradeLtd/go-ipfs-api" ) var ( validIPNSTestPath = "/ipns/docs.api.temporal.cloud" badIPNSTestPath = "/not/a/real/path" valid...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/types.go
api/v2/types.go
package v2 import ( "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/kaas/v2" xss "github.com/dvwright/xss-mw" pbLens "github.com/RTradeLtd/grpc/lensv2" pbOrch "github.com/RTradeLtd/grpc/nexus" pbSigner "github.com/RTradeLtd/grpc/pay" pbBchWallet "github.com/gcash/bchwallet/rpc/walletrpc" ) var ( ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_rtfs.go
api/v2/routes_rtfs.go
package v2 import ( "bytes" "errors" "html" "io" "io/ioutil" "net/http" "github.com/c2h5oh/datasize" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/Temporal/utils" "github.com/RTradeLtd/crypto/v2" "github.com/RTradeLtd/database/v2/models" ipfsapi "github.c...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_ens.go
api/v2/routes_ens.go
package v2 import ( "errors" "net/http" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/database/v2/models" "github.com/gin-gonic/gin" gocid "github.com/ipfs/go-cid" ) // ClaimENSName is used to claim a username based ens subdomain func (api *API) ClaimENSName(c ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/context_test.go
api/v2/context_test.go
package v2 import ( "net/http" "testing" ) func Test_status(t *testing.T) { type args struct { i []int } tests := []struct { name string args args wantStatus int }{ {"given code", args{[]int{404}}, 404}, {"not given code", args{[]int{}}, http.StatusBadRequest}, {"given nil", args{nil},...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_rtfsp_usage.go
api/v2/routes_rtfsp_usage.go
package v2 import ( "bytes" "errors" "html" "io" "io/ioutil" "net/http" "time" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/crypto/v2" "github.com/RTradeLtd/database/v2/models" ipfsapi "github.com/RTradeLtd/go-ipfs-api" "github.com/RTradeLtd/rtfs/v2" goc...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/utils.go
api/v2/utils.go
package v2 import ( "bytes" "errors" "fmt" "io/ioutil" "net/http" "os" "strconv" "time" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/database/v2/models" gpaginator "github.com/RTradeLtd/gpaginator" "github.com/RTradeLtd/swampi" "github.com/c2h5oh/datasize" "github.com/gin-gonic/gin" "github...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_utils.go
api/v2/routes_utils.go
package v2 import ( "bytes" "context" "errors" "fmt" "net/http" "os" "time" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/crypto/v2" "github.com/RTradeLtd/database/v2/models" mnemonics "github.com/RTradeLtd/entropy-mnemonics" pb "github.com/RTradeLtd/grpc/...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_ens_test.go
api/v2/routes_ens_test.go
package v2 import ( "net/url" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" ) func Test_API_Routes_ENS(t *testing.T) { // load configuration cfg, err := config.LoadConfig("../../testenv/config.json") if err != nil { t.Fatal(err) } db, err := loadDatabase(cfg) if err != ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/api_test.go
api/v2/api_test.go
package v2 import ( "context" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "net/http/httptest" "net/url" "strings" "testing" "time" "go.uber.org/zap/zaptest" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/Temporal/rtfscluster" "github.com/RTrade...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_account.go
api/v2/routes_account.go
package v2 import ( "errors" "fmt" "html" "net/http" "strconv" "strings" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/Temporal/queue" "github.com/RTradeLtd/database/v2/models" "github.com/gin-gonic/gin" ) // getUserFromToken is used to get the username of the associated token func (api *API) ge...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_frontend_test.go
api/v2/routes_frontend_test.go
package v2 import ( "bytes" "encoding/json" "io" "io/ioutil" "mime/multipart" "net/http/httptest" "net/url" "os" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" ) func Test_API_Routes_Frontend(t *testing.T) { // load configuration cfg, err := config.LoadConfig("../../tes...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_database_test.go
api/v2/routes_database_test.go
package v2 import ( "net/url" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2/models" ) func Test_API_Routes_Database(t *testing.T) { // load configuration cfg, err := config.LoadConfig("../../testenv/config.json") if err != nil { t.Fatal(e...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_lens.go
api/v2/routes_lens.go
package v2 import ( "errors" "net/http" "github.com/RTradeLtd/Temporal/eh" pb "github.com/RTradeLtd/grpc/lensv2" "github.com/gin-gonic/gin" gocid "github.com/ipfs/go-cid" ) func (api *API) submitIndexRequest(c *gin.Context) { // extract post forms forms, missingField := api.extractPostForms(c, "object_type",...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/log.go
api/v2/log.go
package v2 import ( "github.com/gin-gonic/gin" ) // LogError is a wrapper used by the API to handle logging of errors. Returns a // callback to also fail a gin context with an optional status code, which // defaults to http.StatusInternalServerError. Fields is an optional set of // params provided in pairs, where th...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/utils_test.go
api/v2/utils_test.go
package v2 import ( "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/Temporal/utils" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2/models" ) func TestEmailJWT(t *testing.T) { // load configuration cfg, err := config.LoadConfig("../../testenv/config.json") if err != n...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_swarm_test.go
api/v2/routes_swarm_test.go
package v2 import ( "bytes" "encoding/json" "io" "io/ioutil" "mime/multipart" "net/http/httptest" "net/url" "os" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" ) func Test_Routes_Swarm(t *testing.T) { // load configuration cfg, err := config.LoadConfig("../../testenv/co...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_account_test.go
api/v2/routes_account_test.go
package v2 import ( "net/url" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2/models" ) func Test_API_Routes_Account(t *testing.T) { // load configuration cfg, err := config.LoadConfig("../../testenv/config.json") if err != nil { t.Fatal(er...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/context.go
api/v2/context.go
package v2 import ( "errors" "fmt" "net/http" "strings" jwt "github.com/appleboy/gin-jwt" "github.com/gin-gonic/gin" ) // Fail fails context with given error and optional status code. Defaults to // http.StatusInternalServerError func Fail(c *gin.Context, err error, code ...int) { c.JSON(status(code), gin.H{ ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_rtfsp_test.go
api/v2/routes_rtfsp_test.go
package v2 import ( "bytes" "encoding/json" "io" "io/ioutil" "mime/multipart" "net/http/httptest" "net/url" "os" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2/models" pbOrch "github.com/RTradeLtd/grpc/nexus" ) func Test_API_Routes_IPFS...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_rtfs_test.go
api/v2/routes_rtfs_test.go
package v2 import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "mime/multipart" "net/http/httptest" "net/url" "os" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2/models" ) func Test_API_Routes_IPFS_Public(t *testing.T) { // load co...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_lens_test.go
api/v2/routes_lens_test.go
package v2 import ( "errors" "net/url" "testing" "github.com/RTradeLtd/Temporal/mocks" "github.com/RTradeLtd/config/v2" pb "github.com/RTradeLtd/grpc/lensv2" ) var ( lensTestHash = "QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv" ) func Test_API_Routes_Lens_Index(t *testing.T) { type args struct { objectT...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/doc.go
api/v2/doc.go
// Package v2 is the main package for Temporal's V2 http API. // API reference is available [here](https://documenter.getpostman.com/view/4295780/RWEcQM6W#intro) package v2
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_swarm.go
api/v2/routes_swarm.go
package v2 import ( "errors" "io/ioutil" "net/http" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/Temporal/utils" "github.com/RTradeLtd/database/v2/models" "github.com/gin-gonic/gin" ) // SwarmUpload is used to upload data to ethereum swarm func (api *API) SwarmUpload(c *gin.Context) { if len(api....
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/api/v2/routes_database.go
api/v2/routes_database.go
package v2 import ( "errors" "html" "net/http" "strings" "github.com/RTradeLtd/Temporal/eh" "github.com/RTradeLtd/database/v2/models" "github.com/gin-gonic/gin" ) // allows performing arbitrary searches against upload file names func (api *API) searchUploadsForUser(c *gin.Context) { username, err := GetAuthe...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/queue_test.go
queue/queue_test.go
package queue import ( "context" "sync" "testing" "time" "go.uber.org/zap/zaptest" "github.com/streadway/amqp" "github.com/RTradeLtd/config/v2" "github.com/RTradeLtd/database/v2" "github.com/jinzhu/gorm" ) const ( testCID = "QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv" testCID2 = "...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/ipfs.go
queue/ipfs.go
package queue import ( "context" "encoding/json" "errors" "fmt" "strings" "sync" "time" kaas "github.com/RTradeLtd/kaas/v2" "github.com/RTradeLtd/rtfs/v2" "github.com/RTradeLtd/database/v2/models" "github.com/jinzhu/gorm" "github.com/streadway/amqp" "go.bobheadxi.dev/zapx/zapx" pb "github.com/RTradeLt...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/log_test.go
queue/log_test.go
package queue import ( "testing" "github.com/RTradeLtd/config/v2" "go.uber.org/zap" "go.uber.org/zap/zaptest/observer" ) func TestLog_Publisher(t *testing.T) { dev = true cfg, err := config.LoadConfig(testCfgPath) if err != nil { t.Fatal(err) } observer, out := observer.New(zap.InfoLevel) logger := zap.N...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/types.go
queue/types.go
package queue import ( "time" "github.com/RTradeLtd/config/v2" "github.com/jinzhu/gorm" "go.uber.org/zap" "github.com/streadway/amqp" ) // Various variables and types used by our queue package // Queue is a typed string used to declare the various queue names type Queue string func (qt Queue) String() string...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/utils.go
queue/utils.go
package queue import ( "github.com/RTradeLtd/database/v2/models" ) // refundCredits is used to refund a users credits. We do not check for errors, // as these are logged and manually corrected if they occur func (qm *Manager) refundCredits(username, callType string, cost float64) error { if cost == 0 { return nil...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/ipns.go
queue/ipns.go
package queue import ( "context" "encoding/json" "errors" "sync" "time" ci "github.com/libp2p/go-libp2p-core/crypto" peer "github.com/libp2p/go-libp2p-core/peer" "github.com/streadway/amqp" "github.com/RTradeLtd/database/v2/models" pb "github.com/RTradeLtd/grpc/krab" kaas "github.com/RTradeLtd/kaas/v2" "...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/ipfs_cluster.go
queue/ipfs_cluster.go
package queue import ( "context" "encoding/json" "errors" "sync" "github.com/RTradeLtd/Temporal/rtfscluster" "github.com/RTradeLtd/database/v2/models" "github.com/jinzhu/gorm" "github.com/streadway/amqp" ) // ProcessIPFSClusterPins is used to process messages sent to rabbitmq requesting be pinned to our clus...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/mail.go
queue/mail.go
package queue import ( "context" "encoding/json" "errors" "sync" "github.com/RTradeLtd/Temporal/mail" "github.com/jinzhu/gorm" "github.com/streadway/amqp" ) // ProcessMailSends is a function used to process mail send queue messages func (qm *Manager) ProcessMailSends(ctx context.Context, wg *sync.WaitGroup, d...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/doc.go
queue/doc.go
// Package queue implements Temporal's various queue consumers and publishers package queue
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/queue/queue.go
queue/queue.go
package queue import ( "context" "crypto/tls" "crypto/x509" "encoding/json" "errors" "io/ioutil" "sync" "github.com/jinzhu/gorm" "go.uber.org/zap" "github.com/RTradeLtd/config/v2" "github.com/streadway/amqp" ) // New is used to instantiate a new connection to rabbitmq as a publisher or consumer func New(...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/log/middleware.go
log/middleware.go
package log import ( "time" "net/http" "github.com/go-chi/chi/middleware" "go.uber.org/zap" ) type loggerMiddleware struct { l *zap.Logger } // NewMiddleware instantiates a middleware function that logs all requests // using the provided logger func NewMiddleware(l *zap.SugaredLogger) func(next http.Handler) ...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/log/middleware_test.go
log/middleware_test.go
package log import ( "io" "net/http" "net/http/httptest" "testing" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" "go.bobheadxi.dev/res" "go.bobheadxi.dev/zapx/ztest" ) func Test_loggerMiddleware(t *testing.T) { type args struct { method string path string body io.Reader...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/log/log_test.go
log/log_test.go
package log import ( "testing" "go.bobheadxi.dev/zapx/ztest" ) func TestNewProcessLogger(t *testing.T) { l, out := ztest.NewObservable() logger := NewProcessLogger(l.Sugar(), "network_up", "id", "1234") logger.Info("hi") if out.All()[0].ContextMap()["network_up.id"].(string) != "1234" { t.Error("bad logger")...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/log/log.go
log/log.go
package log import ( "go.uber.org/zap" ) // NewProcessLogger creates a new logger that sets prefixes on fields for // logging a specific process func NewProcessLogger(l *zap.SugaredLogger, process string, fields ...interface{}) *zap.SugaredLogger { args := make([]interface{}, len(fields)) for i := 0; i < len(field...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/log/doc.go
log/doc.go
// Package log provides utility functions that wrap Uber's Zap logging library package log
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/eh/errors.go
eh/errors.go
package eh const ( // LoginError indicates an unexpected error occurred when logging in LoginError = "an error occurred while signing in" // IPFSConnectionError is an error used for ipfs connection failures IPFSConnectionError = "failed to connect to ipfs" // PrivateNetworkAccessError is used for invalid access t...
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
RTradeLtd/Temporal
https://github.com/RTradeLtd/Temporal/blob/4547df5e64d9823c6f670da4261de9e6d7353fb8/eh/doc.go
eh/doc.go
// Package eh stands for "error handling", and provides error definitions package eh
go
MIT
4547df5e64d9823c6f670da4261de9e6d7353fb8
2026-01-07T09:35:24.447786Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/main.go
main.go
package main import ( "beaver/app/backend/backend_models" "beaver/app/chat/chat_models" "beaver/app/datasync/datasync_models" "beaver/app/emoji/emoji_models" "beaver/app/feedback/feedback_models" "beaver/app/file/file_models" "beaver/app/friend/friend_models" "beaver/app/group/group_models" "beaver/app/moment...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_models/chat_conversation_setting_model.go
app/chat/chat_models/chat_conversation_setting_model.go
package chat_models import ( "beaver/common/models" ) // 存储用户级别的会话设置(每个用户独立) // 记录用户对会话的个性化操作(置顶、免打扰、删除等) // 记录用户在该会话中的已读状态 // 用于UI显示(会话列表、未读消息等) type ChatUserConversation struct { models.Model UserID string `gorm:"size:64;index" json:"userId"` // 用户ID ConversationID string `gorm:"size:128;index...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_models/chat_datasync_model.go
app/chat/chat_models/chat_datasync_model.go
package chat_models import ( "beaver/common/models" ) // 存储会话级别的信息(所有用户共享) // 记录会话类型(私聊/群聊) // 记录会话的最新消息序列号 // 用于数据同步(客户端需要知道哪些会话有更新) // ChatConversationMeta 数据同步模型 type ChatConversationMeta struct { models.Model ConversationID string `gorm:"size:128;uniqueIndex" json:"conversationId"` // 唯一会话ID(私聊/群聊/系统) Type ...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_models/chat_model.go
app/chat/chat_models/chat_model.go
package chat_models import ( "beaver/common/models" "beaver/common/models/ctype" ) type ChatMessage struct { models.Model MessageID string `gorm:"size:64;uniqueIndex" json:"messageId"` // 唯一消息ID(客户端生成+服务端确认) ConversationID string `gorm:"size:128;index" json:"conversationId"` ...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_utils/sync_utils.go
app/chat/chat_utils/sync_utils.go
package chat_utils import ( "strings" "time" "beaver/app/chat/chat_models" core "beaver/core/version" "github.com/zeromicro/go-zero/core/logx" "gorm.io/gorm" ) // CreateOrUpdateConversation 更新会话信息,返回新版本号(表记录肯定存在) func CreateOrUpdateConversation(db *gorm.DB, versionGen *core.VersionGenerator, conversationID st...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/chat.go
app/chat/chat_api/chat.go
package main import ( "beaver/app/chat/chat_api/internal/config" "beaver/app/chat/chat_api/internal/handler" "beaver/app/chat/chat_api/internal/svc" "beaver/common/etcd" "beaver/common/middleware" "flag" "fmt" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/rest" ) var configFile = fl...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/svc/servicecontext.go
app/chat/chat_api/internal/svc/servicecontext.go
package svc import ( "beaver/app/chat/chat_api/internal/config" "beaver/app/chat/chat_rpc/chat" "beaver/app/chat/chat_rpc/types/chat_rpc" "beaver/app/friend/friend_rpc/friend" "beaver/app/friend/friend_rpc/types/friend_rpc" "beaver/app/group/group_rpc/group" "beaver/app/group/group_rpc/types/group_rpc" "beaver...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/types/types.go
app/chat/chat_api/internal/types/types.go
// Code generated by goctl. DO NOT EDIT. package types type AudioFileMsg struct { FileKey string `json:"fileKey"` //音频文件ID FileName string `json:"fileName,optional"` //原始文件名(可选,用于显示) Duration int `json:"duration,optional"` //音频时长(秒,可选) Size int64 `json:"size,optional"` //文件大小(字节,可选) } type ...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/config/config.go
app/chat/chat_api/internal/config/config.go
package config import ( "github.com/zeromicro/go-zero/rest" "github.com/zeromicro/go-zero/zrpc" ) type Config struct { rest.RestConf Mysql struct { DataSource string } Redis struct { Addr string Password string Db int } Etcd string UserRpc zrpc.RpcClientConf ChatRpc zrpc.RpcClient...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/hidechathandler.go
app/chat/chat_api/internal/handler/hidechathandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func hideChatHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/getuserconversationsettingslistbyidshandler.go
app/chat/chat_api/internal/handler/getuserconversationsettingslistbyidshandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func getUserConversationSettingsListByIdsHandler(svcCtx *svc.ServiceContext) http....
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/recentchatlisthandler.go
app/chat/chat_api/internal/handler/recentchatlisthandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func recentChatListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return ...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/editmessagehandler.go
app/chat/chat_api/internal/handler/editmessagehandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func editMessageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return fun...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/deleterecenthandler.go
app/chat/chat_api/internal/handler/deleterecenthandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func deleteRecentHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return fu...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/mutechathandler.go
app/chat/chat_api/internal/handler/mutechathandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func muteChatHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/updatereadseqhandler.go
app/chat/chat_api/internal/handler/updatereadseqhandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func updateReadSeqHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return f...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/sendmsghandler.go
app/chat/chat_api/internal/handler/sendmsghandler.go
package handler import ( "errors" "net/http" "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "github.com/zeromicro/go-zero/rest/httpx" ) func SendMsgHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { ret...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/conversationinfohandler.go
app/chat/chat_api/internal/handler/conversationinfohandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func ConversationInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { retur...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false
wsrh8888/beaver-server
https://github.com/wsrh8888/beaver-server/blob/71409b80d00457511f57d8fec96e7366a8520b60/app/chat/chat_api/internal/handler/chathistoryhandler.go
app/chat/chat_api/internal/handler/chathistoryhandler.go
package handler import ( "beaver/app/chat/chat_api/internal/logic" "beaver/app/chat/chat_api/internal/svc" "beaver/app/chat/chat_api/internal/types" "beaver/common/response" "net/http" "github.com/zeromicro/go-zero/rest/httpx" ) func chatHistoryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return fun...
go
MIT
71409b80d00457511f57d8fec96e7366a8520b60
2026-01-07T09:45:42.639179Z
false