예제 #1
0
파일: generated.go 프로젝트: kego/ke
func UnpackPageInterface(ctx context.Context, in system.Packed) (PageInterface, error) {
	switch in.Type() {
	case system.J_MAP:
		i, err := system.UnpackUnknownType(ctx, in, true, "kego.io/demo/demo2", "page")
		if err != nil {
			return nil, err
		}
		ob, ok := i.(PageInterface)
		if !ok {
			return nil, fmt.Errorf("%T does not implement PageInterface", i)
		}
		return ob, nil
	default:
		return nil, fmt.Errorf("Unsupported json type %s when unpacking into PageInterface.", in.Type())
	}
}
예제 #2
0
파일: generated.go 프로젝트: kego/ke
func UnpackSection(ctx context.Context, in system.Packed) (Section, error) {
	switch in.Type() {
	case system.J_MAP:
		i, err := system.UnpackUnknownType(ctx, in, true, "kego.io/demo/site", "section")
		if err != nil {
			return nil, err
		}
		ob, ok := i.(Section)
		if !ok {
			return nil, fmt.Errorf("%T does not implement Section", i)
		}
		return ob, nil
	default:
		return nil, fmt.Errorf("Unsupported json type %s when unpacking into Section.", in.Type())
	}
}
예제 #3
0
파일: generated.go 프로젝트: kego/ke
func UnpackFInterface(ctx context.Context, in system.Packed) (FInterface, error) {
	switch in.Type() {
	case system.J_MAP:
		i, err := system.UnpackUnknownType(ctx, in, true, "kego.io/process/validate/tests", "f")
		if err != nil {
			return nil, err
		}
		ob, ok := i.(FInterface)
		if !ok {
			return nil, fmt.Errorf("%T does not implement FInterface", i)
		}
		return ob, nil
	default:
		return nil, fmt.Errorf("Unsupported json type %s when unpacking into FInterface.", in.Type())
	}
}
예제 #4
0
파일: generated.go 프로젝트: kego/ke
func UnpackLocalized(ctx context.Context, in system.Packed) (Localized, error) {
	switch in.Type() {
	case system.J_MAP:
		i, err := system.UnpackUnknownType(ctx, in, true, "kego.io/demo/demo5/translation", "localized")
		if err != nil {
			return nil, err
		}
		ob, ok := i.(Localized)
		if !ok {
			return nil, fmt.Errorf("%T does not implement Localized", i)
		}
		return ob, nil
	default:
		return nil, fmt.Errorf("Unsupported json type %s when unpacking into Localized.", in.Type())
	}
}