state

package
v1.0.0-alpha.999 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StateFileDir  = "build"
	StateFileName = "state"
)

Functions

func BindRpcFunction

func BindRpcFunction(rpc raiden.Rpc, fn *objects.Function) (err error)

func BindToSupabaseRole

func BindToSupabaseRole(r *objects.Role, role raiden.Role)

func BindToSupabaseStorage

func BindToSupabaseStorage(s *objects.Bucket, storage raiden.Bucket)

func BuildRoleFromState

func BuildRoleFromState(rs RoleState, role raiden.Role) (r objects.Role)

func BuildStorageFromState

func BuildStorageFromState(ss StorageState, storage raiden.Bucket) (s objects.Bucket)

func CreateTmpState

func CreateTmpState(stateFile string) string

func GetStateFilePath

func GetStateFilePath() (path string, err error)

func RestoreFromTmp

func RestoreFromTmp(tmpFile string)

func Save

func Save(state *State) error

Types

type ExtractRoleResult

type ExtractRoleResult struct {
	Existing []objects.Role
	New      []objects.Role
	Delete   []objects.Role
}

func ExtractRole

func ExtractRole(roleStates []RoleState, appRoles []raiden.Role, withNativeRole bool) (result ExtractRoleResult, err error)

type ExtractRpcResult

type ExtractRpcResult struct {
	Existing []objects.Function
	New      []objects.Function
	Delete   []objects.Function
}

func ExtractRpc

func ExtractRpc(rpcState []RpcState, appRpc []raiden.Rpc) (result ExtractRpcResult, err error)

type ExtractStorageResult

type ExtractStorageResult struct {
	Existing []objects.Bucket
	New      []objects.Bucket
	Delete   []objects.Bucket
}

func ExtractStorage

func ExtractStorage(storageStates []StorageState, appStorages []raiden.Bucket) (result ExtractStorageResult, err error)

type ExtractTableItem

type ExtractTableItem struct {
	Table             objects.Table
	Policies          objects.Policies
	ExtractedPolicies ExtractedPolicies
}

type ExtractTableItems

type ExtractTableItems []ExtractTableItem

func (ExtractTableItems) ToFlatTable

func (f ExtractTableItems) ToFlatTable() (tables []objects.Table)

type ExtractTableResult

type ExtractTableResult struct {
	Existing ExtractTableItems
	New      ExtractTableItems
	Delete   ExtractTableItems
}

func ExtractTable

func ExtractTable(tableStates []TableState, appTable []any) (result ExtractTableResult, err error)

type ExtractedPolicies

type ExtractedPolicies struct {
	Existing []objects.Policy
	New      []objects.Policy
	Delete   []objects.Policy
}

type JoinRelation

type JoinRelation struct {
	SourcePrimaryKey      string
	JoinsSourceForeignKey string

	TargetPrimaryKey     string
	JoinTargetForeignKey string

	Through string
}

type Relation

type Relation struct {
	Table        string
	Type         string
	RelationType raiden.RelationType
	PrimaryKey   string
	ForeignKey   string
	Tag          string
	*JoinRelation
}

type RoleState

type RoleState struct {
	Role       objects.Role
	RolePath   string
	RoleStruct string
	IsNative   bool
	LastUpdate time.Time
}

type RpcState

type RpcState struct {
	Function   objects.Function
	RpcPath    string
	RpcStruct  string
	LastUpdate time.Time
}

type State

type State struct {
	Tables  []TableState
	Roles   []RoleState
	Rpc     []RpcState
	Storage []StorageState
}

func Load

func Load() (*State, error)

type StorageState

type StorageState struct {
	Bucket     objects.Bucket
	LastUpdate time.Time
}

type TableState

type TableState struct {
	Table       objects.Table
	Relation    []Relation
	ModelPath   string
	ModelStruct string
	LastUpdate  time.Time
	Policies    []objects.Policy
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL