// itemFromRole attempts to encode the supplied role as an
// instance of `backend.Item` suitable for storage.
itemFromRole attempts to encode the supplied role as an
instance of `backend.Item` suitable for storage.
// itemFromRole attempts to encode the supplied role as an // instance of ` backend . Item ` suitable for storage .
func itemFromRole(role services.Role) (*backend.Item, error) {
	value, err := services.GetRoleMarshaler().MarshalRole(role)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	item := &backend.Item{
		Key:     backend.Key(rolesPrefix, role.GetName(), paramsPrefix),
		Value:   value,
		Expires: role.Expiry(),
		ID:      role.GetResourceID(),
	}
	return item, nil
}
func itemFromRole ( role services . Role ) ( * backend . Item , error ) { value , err := services . GetRoleMarshaler ( ) . MarshalRole ( role ) if err != nil { return nil , trace . Wrap ( err ) } item := & backend . Item { Key : backend . Key ( rolesPrefix , role . GetName ( ) , paramsPrefix ) , Value : value , Expires : role . Expiry ( ) , ID : role . GetResourceID ( ) , } return item , nil }
itemFromRole attempts to encode the supplied role as an
instance of `backend.Item` suitable for storage.
itemFromRole attempts to encode the supplied role as an instance of ` backend . Item ` suitable for storage .