Documentation
¶
Overview ¶
Example ¶
type Name struct { FirstName string `scim:"givenName"` LastName string `scim:"familyName"` } type ResourceStruct struct { UserName string Name Name } resourceStruct := ResourceStruct{ UserName: "di-wu", Name: Name{ FirstName: "Quint", LastName: "Daenen", }, } r, _ := Marshal(resourceStruct) fmt.Println(r) resourceMap := map[string]interface{}{ "userName": "di-wu", "name": map[string]interface{}{ "givenName": "Quint", "familyName": "Daenen", }, } var resource ResourceStruct _ = Unmarshal(resourceMap, &resource) fmt.Println(resource)
Output: map[name:map[familyName:Daenen givenName:Quint] userName:di-wu] {di-wu {Quint Daenen}}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unmarshal ¶
Example ¶
var r testUnmarshalInterface _ = Unmarshal(map[string]interface{}{ "name": "Quint", }, &r) fmt.Println(r)
Output: {Quint}
Example (Extension) ¶
type EnterpriseUserExtension struct { EmployeeNumber string } type User struct { UserName string EnterpriseUser EnterpriseUserExtension `scim:"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"` } var user User _ = Unmarshal(map[string]interface{}{ "userName": "di-wu", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": map[string]interface{}{ "employeeNumber": "0001", }, }, &user) fmt.Println(user)
Output: {di-wu {0001}}
Types ¶
type IDMarshaler ¶
type IDUnMarshaler ¶
type IDUnMarshaler interface {
UnmarshalSCIMUUID(interface{}) error
}
type Marshaler ¶
Marshaler is the interface implemented by types that can marshal themselves into SCIM resources.
type Unmarshaler ¶
Unmarshaler is the interface implemented by types that can unmarshal a SCIM description of themselves.
Click to show internal directories.
Click to hide internal directories.