mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
rename app folder to internal.
This commit is contained in:
parent
afb90af1db
commit
9974bfe3fd
28 changed files with 23 additions and 23 deletions
|
|
@ -18,12 +18,12 @@ import (
|
||||||
_ "github.com/eosswedenorg/thalos/api/message/json"
|
_ "github.com/eosswedenorg/thalos/api/message/json"
|
||||||
_ "github.com/eosswedenorg/thalos/api/message/msgpack"
|
_ "github.com/eosswedenorg/thalos/api/message/msgpack"
|
||||||
api_redis "github.com/eosswedenorg/thalos/api/redis"
|
api_redis "github.com/eosswedenorg/thalos/api/redis"
|
||||||
"github.com/eosswedenorg/thalos/app"
|
"github.com/eosswedenorg/thalos/internal/abi"
|
||||||
"github.com/eosswedenorg/thalos/app/abi"
|
. "github.com/eosswedenorg/thalos/internal/cache"
|
||||||
. "github.com/eosswedenorg/thalos/app/cache"
|
"github.com/eosswedenorg/thalos/internal/config"
|
||||||
"github.com/eosswedenorg/thalos/app/config"
|
driver "github.com/eosswedenorg/thalos/internal/driver/redis"
|
||||||
driver "github.com/eosswedenorg/thalos/app/driver/redis"
|
. "github.com/eosswedenorg/thalos/internal/log"
|
||||||
. "github.com/eosswedenorg/thalos/app/log"
|
. "github.com/eosswedenorg/thalos/internal/server"
|
||||||
redis_cache "github.com/go-redis/cache/v9"
|
redis_cache "github.com/go-redis/cache/v9"
|
||||||
"github.com/nikoksr/notify"
|
"github.com/nikoksr/notify"
|
||||||
"github.com/nikoksr/notify/service/telegram"
|
"github.com/nikoksr/notify/service/telegram"
|
||||||
|
|
@ -46,7 +46,7 @@ var cache *Cache
|
||||||
|
|
||||||
var cacheStore Store
|
var cacheStore Store
|
||||||
|
|
||||||
func readerLoop(processor *app.ShipProcessor) {
|
func readerLoop(processor *ShipProcessor) {
|
||||||
recon_cnt := 0
|
recon_cnt := 0
|
||||||
|
|
||||||
exp := &backoff.ExponentialBackOff{
|
exp := &backoff.ExponentialBackOff{
|
||||||
|
|
@ -128,7 +128,7 @@ func readerLoop(processor *app.ShipProcessor) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func run(processor *app.ShipProcessor) {
|
func run(processor *ShipProcessor) {
|
||||||
// Spawn reader loop in another thread.
|
// Spawn reader loop in another thread.
|
||||||
go readerLoop(processor)
|
go readerLoop(processor)
|
||||||
|
|
||||||
|
|
@ -170,8 +170,8 @@ func initAbiManger(api *eos.API, chain_id string) *abi.AbiManager {
|
||||||
return abi.NewAbiManager(cache, api)
|
return abi.NewAbiManager(cache, api)
|
||||||
}
|
}
|
||||||
|
|
||||||
func stateLoader(chainInfo *eos.InfoResp, current_block_no_cache bool) app.StateLoader {
|
func stateLoader(chainInfo *eos.InfoResp, current_block_no_cache bool) StateLoader {
|
||||||
return func(state *app.State) {
|
return func(state *State) {
|
||||||
var source string
|
var source string
|
||||||
|
|
||||||
// Load state from cache.
|
// Load state from cache.
|
||||||
|
|
@ -207,7 +207,7 @@ func stateLoader(chainInfo *eos.InfoResp, current_block_no_cache bool) app.State
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func stateSaver(state app.State) error {
|
func stateSaver(state State) error {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*500)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*500)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
return cache.Set(ctx, "state", state, 0)
|
return cache.Set(ctx, "state", state, 0)
|
||||||
|
|
@ -337,7 +337,7 @@ func serverCmd(ctx *cli.Context) error {
|
||||||
|
|
||||||
chain_id := getChain(chainInfo.ChainID.String())
|
chain_id := getChain(chainInfo.ChainID.String())
|
||||||
|
|
||||||
processor := app.SpawnProccessor(
|
processor := SpawnProccessor(
|
||||||
shClient,
|
shClient,
|
||||||
stateLoader(chainInfo, skip_currentblock_cache),
|
stateLoader(chainInfo, skip_currentblock_cache),
|
||||||
stateSaver,
|
stateSaver,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
|
||||||
_ "github.com/eosswedenorg/thalos/app/log"
|
_ "github.com/eosswedenorg/thalos/internal/log"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/eosswedenorg/thalos/api/message"
|
"github.com/eosswedenorg/thalos/api/message"
|
||||||
_ "github.com/eosswedenorg/thalos/api/message/json"
|
_ "github.com/eosswedenorg/thalos/api/message/json"
|
||||||
api_redis "github.com/eosswedenorg/thalos/api/redis"
|
api_redis "github.com/eosswedenorg/thalos/api/redis"
|
||||||
redis_driver "github.com/eosswedenorg/thalos/app/driver/redis"
|
redis_driver "github.com/eosswedenorg/thalos/internal/driver/redis"
|
||||||
|
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
eos "github.com/eoscanada/eos-go"
|
eos "github.com/eoscanada/eos-go"
|
||||||
"github.com/eosswedenorg/thalos/app/cache"
|
"github.com/eosswedenorg/thalos/internal/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AbiManager handles an ABI cache that fetches the ABI from an API on cache miss.
|
// AbiManager handles an ABI cache that fetches the ABI from an API on cache miss.
|
||||||
|
|
@ -9,7 +9,7 @@ import (
|
||||||
|
|
||||||
eos "github.com/eoscanada/eos-go"
|
eos "github.com/eoscanada/eos-go"
|
||||||
|
|
||||||
"github.com/eosswedenorg/thalos/app/cache"
|
"github.com/eosswedenorg/thalos/internal/cache"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
0
app/cache/cache.go → internal/cache/cache.go
vendored
0
app/cache/cache.go → internal/cache/cache.go
vendored
0
app/cache/store.go → internal/cache/store.go
vendored
0
app/cache/store.go → internal/cache/store.go
vendored
|
|
@ -3,7 +3,7 @@ package config
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/eosswedenorg/thalos/app/log"
|
"github.com/eosswedenorg/thalos/internal/log"
|
||||||
|
|
||||||
shipclient "github.com/eosswedenorg-go/antelope-ship-client"
|
shipclient "github.com/eosswedenorg-go/antelope-ship-client"
|
||||||
)
|
)
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/eosswedenorg/thalos/app/log"
|
"github.com/eosswedenorg/thalos/internal/log"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
shipclient "github.com/eosswedenorg-go/antelope-ship-client"
|
shipclient "github.com/eosswedenorg-go/antelope-ship-client"
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/eosswedenorg/thalos/app/types"
|
"github.com/eosswedenorg/thalos/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config represents configuration parameters for a log.
|
// Config represents configuration parameters for a log.
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package app
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
|
|
||||||
"github.com/eosswedenorg/thalos/api"
|
"github.com/eosswedenorg/thalos/api"
|
||||||
"github.com/eosswedenorg/thalos/api/message"
|
"github.com/eosswedenorg/thalos/api/message"
|
||||||
"github.com/eosswedenorg/thalos/app/abi"
|
"github.com/eosswedenorg/thalos/internal/abi"
|
||||||
"github.com/eosswedenorg/thalos/app/driver"
|
"github.com/eosswedenorg/thalos/internal/driver"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package app
|
package server
|
||||||
|
|
||||||
// State represents thalos runtime state
|
// State represents thalos runtime state
|
||||||
type State struct {
|
type State struct {
|
||||||
Loading…
Add table
Add a link
Reference in a new issue