Skip to content

Commit

Permalink
reorganise and start htmstrict and storage
Browse files Browse the repository at this point in the history
  • Loading branch information
realPy committed Jul 26, 2023
1 parent e9d41b1 commit c91a503
Show file tree
Hide file tree
Showing 481 changed files with 2,391 additions and 1,561 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"sync"
"syscall/js"

"github.com/realPy/hogosuru/abortsignal"
"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/initinterface"
"github.com/realPy/hogosuru/base/abortsignal"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/initinterface"
)

func init() {
Expand All @@ -18,7 +18,7 @@ var singleton sync.Once

var abortcontrollerinterface js.Value

//GetInterface get the JS interface abortcontroller
// GetInterface get the JS interface abortcontroller
func GetInterface() js.Value {

singleton.Do(func() {
Expand All @@ -35,7 +35,7 @@ func GetInterface() js.Value {
return abortcontrollerinterface
}

//AbortController struct
// AbortController struct
type AbortController struct {
baseobject.BaseObject
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"syscall/js"
"testing"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/event"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/event"
"github.com/realPy/hogosuru/testingutils"
)

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions abortsignal/abortsignal.go → base/abortsignal/abortsignal.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"sync"
"syscall/js"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/eventtarget"
"github.com/realPy/hogosuru/initinterface"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/eventtarget"
"github.com/realPy/hogosuru/base/initinterface"
)

func init() {
Expand All @@ -18,7 +18,7 @@ var singleton sync.Once

var abortsignalinterface js.Value

//GetInterface get the JS interface abortsignal
// GetInterface get the JS interface abortsignal
func GetInterface() js.Value {

singleton.Do(func() {
Expand All @@ -35,7 +35,7 @@ func GetInterface() js.Value {
return abortsignalinterface
}

//AbortSignal struct
// AbortSignal struct
type AbortSignal struct {
eventtarget.EventTarget
}
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion abortsignal/events.go → base/abortsignal/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package abortsignal
import (
"syscall/js"

"github.com/realPy/hogosuru/event"
"github.com/realPy/hogosuru/base/event"
)

func (a AbortSignal) OnAbort(handler func(e event.Event)) (js.Func, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"sync"
"syscall/js"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/event"
"github.com/realPy/hogosuru/initinterface"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/event"
"github.com/realPy/hogosuru/base/initinterface"
)

func init() {
Expand All @@ -20,7 +20,7 @@ var singleton sync.Once

var animationeventinterface js.Value

//AnimationEvent AnimationEvent struct
// AnimationEvent AnimationEvent struct
type AnimationEvent struct {
event.Event
}
Expand All @@ -33,7 +33,7 @@ func (a AnimationEvent) AnimationEvent_() AnimationEvent {
return a
}

//GetInterface get the JS interface animationEvent
// GetInterface get the JS interface animationEvent
func GetInterface() js.Value {

singleton.Do(func() {
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions array/array.go → base/array/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"sync"
"syscall/js"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/initinterface"
"github.com/realPy/hogosuru/iterator"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/initinterface"
"github.com/realPy/hogosuru/base/iterator"
)

func init() {
Expand All @@ -18,7 +18,7 @@ var singleton sync.Once

var arrayinterface js.Value

//GetInterface get the JS interface Array
// GetInterface get the JS interface Array
func GetInterface() js.Value {

singleton.Do(func() {
Expand All @@ -35,7 +35,7 @@ func GetInterface() js.Value {
return arrayinterface
}

//Array struct
// Array struct
type Array struct {
baseobject.BaseObject
}
Expand Down Expand Up @@ -228,7 +228,7 @@ func (a Array) Every(f func(interface{}) bool) (bool, error) {
return result, err
}

//Fill (value, begin, end)
// Fill (value, begin, end)
func (a Array) Fill(i interface{}, opts ...int) error {
var err error
var arrayJS []interface{}
Expand Down
2 changes: 1 addition & 1 deletion array/array_test.go → base/array/array_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"syscall/js"
"testing"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/testingutils"
)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"syscall/js"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/initinterface"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/initinterface"
)

func init() {
Expand All @@ -21,7 +21,7 @@ var singleton sync.Once

var arraybufferinterface js.Value

//GetInterface get the JS interface ArrayBuffer
// GetInterface get the JS interface ArrayBuffer
func GetInterface() js.Value {

singleton.Do(func() {
Expand All @@ -37,7 +37,7 @@ func GetInterface() js.Value {
return arraybufferinterface
}

//ArrayBuffer struct
// ArrayBuffer struct
type ArrayBuffer struct {
baseobject.BaseObject
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"syscall/js"
"testing"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/testingutils"
)

Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions attr/attr.go → base/attr/attr.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"sync"
"syscall/js"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/initinterface"
"github.com/realPy/hogosuru/node"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/initinterface"
"github.com/realPy/hogosuru/base/node"
)

func init() {
Expand All @@ -18,7 +18,7 @@ var singleton sync.Once

var attrinterface js.Value

//GetInterface get the JS interface Attr
// GetInterface get the JS interface Attr
func GetInterface() js.Value {

singleton.Do(func() {
Expand Down
2 changes: 1 addition & 1 deletion attr/attr_test.go → base/attr/attr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package attr
import (
"testing"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/base/baseobject"
)

func TestMain(m *testing.M) {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions baseobject/baseobject.go → base/baseobject/baseobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ func SetSyscall() {
eval_(`hGet = (obj, get ) => { try { return [true,Reflect.get(obj,get)] }catch(err){ return [false,err] } }`)
eval_(`hCall = (obj,method,args) => { try { func=Reflect.get(obj,method); return [true,Reflect.apply(func,obj,args)] } catch (err) { return [false,err] } }`)
eval_(`hInvoke = (func,args) => { try { return [true,Reflect.apply(func,undefined,args)] } catch (err) { return [false,err] } }`)
eval_(`hNew= (func,args) => { try { return [true,Reflect.construct(func,args)] } catch (err) { return [false,err] } }`)

eval_(`hNew = (func,args) => { try { return [true,Reflect.construct(func,args)] } catch (err) { return [false,err] } }`)
setFunc = js.Global().Get("hSet")
getFunc = js.Global().Get("hGet")
callFunc = js.Global().Get("hCall")
invokeFunc = js.Global().Get("hInvoke")
newFunc = js.Global().Get("hNew")

errorInterface = js.Global().Get("Error")
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions blob/blob.go → base/blob/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (

"syscall/js"

"github.com/realPy/hogosuru/arraybuffer"
"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/initinterface"
"github.com/realPy/hogosuru/promise"
"github.com/realPy/hogosuru/stream"
readablestream "github.com/realPy/hogosuru/stream"
"github.com/realPy/hogosuru/base/arraybuffer"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/initinterface"
"github.com/realPy/hogosuru/base/promise"
"github.com/realPy/hogosuru/base/stream"
readablestream "github.com/realPy/hogosuru/base/stream"
)

func init() {
Expand All @@ -25,7 +25,7 @@ var singleton sync.Once

var blobinterface js.Value

//GetInterface get the JS interface Blob
// GetInterface get the JS interface Blob
func GetInterface() js.Value {

singleton.Do(func() {
Expand Down
8 changes: 4 additions & 4 deletions blob/blob_test.go → base/blob/blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"syscall/js"
"testing"

"github.com/realPy/hogosuru/array"
"github.com/realPy/hogosuru/arraybuffer"
"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/base/array"
"github.com/realPy/hogosuru/base/arraybuffer"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/typedarray"
"github.com/realPy/hogosuru/testingutils"
"github.com/realPy/hogosuru/typedarray"
)

func TestMain(m *testing.M) {
Expand Down
8 changes: 4 additions & 4 deletions blob/blobstream.go → base/blob/blobstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package blob
import (
"syscall/js"

"github.com/realPy/hogosuru/arraybuffer"
"github.com/realPy/hogosuru/jserror"
"github.com/realPy/hogosuru/promise"
"github.com/realPy/hogosuru/typedarray"
"github.com/realPy/hogosuru/base/arraybuffer"
"github.com/realPy/hogosuru/base/jserror"
"github.com/realPy/hogosuru/base/promise"
"github.com/realPy/hogosuru/base/typedarray"
)

type BlobStream struct {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (

"syscall/js"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/eventtarget"
"github.com/realPy/hogosuru/initinterface"
"github.com/realPy/hogosuru/messageevent"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/eventtarget"
"github.com/realPy/hogosuru/base/initinterface"
"github.com/realPy/hogosuru/base/messageevent"
)

func init() {
Expand All @@ -23,7 +23,7 @@ var singleton sync.Once

var bcinterface js.Value

//BroadcastChannel struct
// BroadcastChannel struct
type BroadcastChannel struct {
eventtarget.EventTarget
}
Expand All @@ -36,7 +36,7 @@ func (b BroadcastChannel) BroadcastChannel_() BroadcastChannel {
return b
}

//GetJSInterface get the JS interface
// GetJSInterface get the JS interface
func GetInterface() js.Value {

singleton.Do(func() {
Expand All @@ -52,7 +52,7 @@ func GetInterface() js.Value {
return bcinterface
}

//New Get a new channel broadcast
// New Get a new channel broadcast
func New(channelname string) (BroadcastChannel, error) {
var channel BroadcastChannel
var err error
Expand All @@ -64,14 +64,14 @@ func New(channelname string) (BroadcastChannel, error) {
return channel, err
}

//PostMessage Post a message on channel
// PostMessage Post a message on channel
func (c BroadcastChannel) PostMessage(message interface{}) error {
var err error
_, err = c.Call("postMessage", baseobject.GetJsValueOf(message))
return err
}

//Close Close the channel
// Close Close the channel
func (c BroadcastChannel) Close() error {
var err error
_, err = c.Call("close")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"time"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/messageevent"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/messageevent"
"github.com/realPy/hogosuru/testingutils"
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package broadcastchannel
import (
"syscall/js"

"github.com/realPy/hogosuru/baseobject"
"github.com/realPy/hogosuru/event"
"github.com/realPy/hogosuru/messageevent"
"github.com/realPy/hogosuru/base/baseobject"
"github.com/realPy/hogosuru/base/event"
"github.com/realPy/hogosuru/base/messageevent"
)

func (c BroadcastChannel) OnMessage(handler func(m messageevent.MessageEvent)) (js.Func, error) {
Expand Down

0 comments on commit c91a503

Please sign in to comment.