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