Initial types and interfaces
This commit is contained in:
		
							
								
								
									
										9
									
								
								datastore/skinstore.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								datastore/skinstore.go
									
									
									
									
									
										Normal file
									
								
							@ -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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										9
									
								
								datastore/userstore.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								datastore/userstore.go
									
									
									
									
									
										Normal file
									
								
							@ -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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								datatypes/character.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								datatypes/character.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
package datatypes
 | 
			
		||||
 | 
			
		||||
// Character represents something that can be skinned
 | 
			
		||||
type Character struct {
 | 
			
		||||
	Name string `json:"name"`
 | 
			
		||||
	Skin Skin   `json:"skin"`
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								datatypes/skin.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								datatypes/skin.go
									
									
									
									
									
										Normal file
									
								
							@ -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
 | 
			
		||||
							
								
								
									
										7
									
								
								datatypes/user.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								datatypes/user.go
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
package datatypes
 | 
			
		||||
 | 
			
		||||
// User is an object representing a user
 | 
			
		||||
type User struct {
 | 
			
		||||
	UID        string `json:"uid"`
 | 
			
		||||
	OwnedSkins Skins  `json:"skins"`
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user