diff --git a/README.md b/README.md index d891581..1eb587e 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# OpenSkins-PluginInterface \ No newline at end of file +# OpenSkins-Common \ No newline at end of file diff --git a/datastore/skinstore.go b/datastore/skinstore.go new file mode 100644 index 0000000..316d8d1 --- /dev/null +++ b/datastore/skinstore.go @@ -0,0 +1,9 @@ +package datastore + +import "github.com/josephbmanley/OpenSkins-Common/datatypes" + +type Skinstore interface { + Initialize() error + GetSkin(string) (datatypes.Skin, error) + AddSkin(string, []byte) error +} diff --git a/datastore/userstore.go b/datastore/userstore.go new file mode 100644 index 0000000..51e3ceb --- /dev/null +++ b/datastore/userstore.go @@ -0,0 +1,9 @@ +package datastore + +import "github.com/josephbmanley/OpenSkins-Common/datatypes" + +type Userstore interface { + Initialize() error + GetUser(uid string) (datatypes.User, error) + SetUser(datatypes.User) error +} diff --git a/datatypes/character.go b/datatypes/character.go new file mode 100644 index 0000000..d8d6481 --- /dev/null +++ b/datatypes/character.go @@ -0,0 +1,7 @@ +package datatypes + +// Character represents something that can be skinned +type Character struct { + Name string `json:"name"` + Skin Skin `json:"skin"` +} diff --git a/datatypes/skin.go b/datatypes/skin.go new file mode 100644 index 0000000..7ff65d9 --- /dev/null +++ b/datatypes/skin.go @@ -0,0 +1,11 @@ +package datatypes + +// Skin struct holds the +type Skin struct { + Name string `json:"name"` + Location string `json:"location"` + Metadata map[string]string `json:"metadata"` +} + +// Skins are an array of Skin +type Skins []Skin diff --git a/datatypes/user.go b/datatypes/user.go new file mode 100644 index 0000000..51eb889 --- /dev/null +++ b/datatypes/user.go @@ -0,0 +1,7 @@ +package datatypes + +// User is an object representing a user +type User struct { + UID string `json:"uid"` + OwnedSkins Skins `json:"skins"` +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..73f8a56 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/josephbmanley/OpenSkins-Common + +go 1.13