mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 13:07:09 +00:00
refactor: move session package to pkg directory
This commit is contained in:
parent
0e0a46741f
commit
40f50bf37a
@ -9,10 +9,10 @@ import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"github.com/onsonr/sonr/crypto/ucan"
|
||||
"github.com/onsonr/sonr/internal/database/sessions"
|
||||
"github.com/onsonr/sonr/internal/gateway"
|
||||
"github.com/onsonr/sonr/internal/gateway/config"
|
||||
"github.com/onsonr/sonr/pkg/common/ipfs"
|
||||
"github.com/onsonr/sonr/pkg/database/sessions"
|
||||
"github.com/onsonr/sonr/pkg/didauth/producer"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/internal/database/sessions"
|
||||
"github.com/onsonr/sonr/pkg/common"
|
||||
"github.com/onsonr/sonr/pkg/database/sessions"
|
||||
"github.com/segmentio/ksuid"
|
||||
)
|
||||
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/internal/database/sessions"
|
||||
"github.com/onsonr/sonr/internal/gateway/config"
|
||||
"github.com/onsonr/sonr/pkg/database/sessions"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
@ -2,7 +2,7 @@ package context
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/onsonr/sonr/internal/database/sessions"
|
||||
"github.com/onsonr/sonr/pkg/database/sessions"
|
||||
)
|
||||
|
||||
// ╭───────────────────────────────────────────────────────╮
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
||||
package types
|
||||
package config
|
||||
|
||||
type Config struct {
|
||||
IpfsGatewayUrl string `pkl:"ipfsGatewayUrl" json:"ipfsGatewayUrl,omitempty"`
|
@ -1,5 +1,5 @@
|
||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
||||
package types
|
||||
package config
|
||||
|
||||
import (
|
||||
"context"
|
@ -1,5 +1,5 @@
|
||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
||||
package types
|
||||
package config
|
||||
|
||||
type Environment struct {
|
||||
IsDevelopment bool `pkl:"isDevelopment" json:"isDevelopment,omitempty"`
|
@ -1,5 +1,5 @@
|
||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
||||
package types
|
||||
package config
|
||||
|
||||
type Schema struct {
|
||||
Version int `pkl:"version"`
|
@ -5,7 +5,6 @@ import (
|
||||
|
||||
"github.com/ipfs/boxo/files"
|
||||
"github.com/onsonr/sonr/internal/vault/embed"
|
||||
"github.com/onsonr/sonr/internal/vault/types"
|
||||
)
|
||||
|
||||
const SchemaVersion = 1
|
||||
@ -18,7 +17,7 @@ const (
|
||||
)
|
||||
|
||||
// spawnVaultDirectory creates a new directory with the default files
|
||||
func NewFS(cfg *types.Config) (files.Directory, error) {
|
||||
func NewVaultFS(cfg *Config) (files.Directory, error) {
|
||||
manifestBz, err := newWebManifestBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -36,9 +35,9 @@ func NewFS(cfg *types.Config) (files.Directory, error) {
|
||||
}), nil
|
||||
}
|
||||
|
||||
// GetVaultConfig returns the default vault config
|
||||
func GetVaultConfig(addr string, ucanCID string) *types.Config {
|
||||
return &types.Config{
|
||||
// NewVaultConfig returns the default vault config
|
||||
func NewVaultConfig(addr string, ucanCID string) *Config {
|
||||
return &Config{
|
||||
MotrToken: ucanCID,
|
||||
MotrAddress: addr,
|
||||
IpfsGatewayUrl: "http://localhost:80",
|
@ -1,5 +1,5 @@
|
||||
// Code generated from Pkl module `sonr.motr.DWN`. DO NOT EDIT.
|
||||
package types
|
||||
package config
|
||||
|
||||
import "github.com/apple/pkl-go/pkl"
|
||||
|
@ -4,13 +4,12 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/onsonr/sonr/internal/vault/types"
|
||||
"github.com/onsonr/sonr/pkg/common/models"
|
||||
)
|
||||
|
||||
// DefaultSchema returns the default schema
|
||||
func DefaultSchema() *types.Schema {
|
||||
return &types.Schema{
|
||||
func DefaultSchema() *Schema {
|
||||
return &Schema{
|
||||
Version: SchemaVersion,
|
||||
Account: getSchema(&models.Account{}),
|
||||
Asset: getSchema(&models.Asset{}),
|
@ -1,4 +1,4 @@
|
||||
@go.Package { name = "github.com/onsonr/sonr/internal/vault/types" }
|
||||
@go.Package { name = "github.com/onsonr/sonr/internal/vault/config" }
|
||||
|
||||
module sonr.motr.DWN
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user