From 8dc37e1b6b32269f8f7779ae42830e92077f8b76 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Tue, 22 Jan 2019 19:09:13 +0100 Subject: [PATCH] feat: implement /api/dashboard API endpoint --- api/api.pb.go | 535 +++++-------------------- api/api.proto | 9 +- go.mod | 3 +- go.sum | 1 + main.go | 2 + pkg/dashboard/dashboard.go | 124 ++++-- pkg/dashboard/dashboard.pb.go | 723 ++++++++++++++++++++++++++++++++++ pkg/dashboard/dashboard.proto | 35 ++ pkg/dashboard/entries.go | 70 ---- pkg/soundcloud/soundcloud.go | 4 +- svc/svc.go | 27 +- swagger.yaml | 46 ++- 12 files changed, 1004 insertions(+), 575 deletions(-) create mode 100644 pkg/dashboard/dashboard.pb.go create mode 100644 pkg/dashboard/dashboard.proto delete mode 100644 pkg/dashboard/entries.go diff --git a/api/api.pb.go b/api/api.pb.go index 12cf00fa..f3d80fb0 100644 --- a/api/api.pb.go +++ b/api/api.pb.go @@ -14,6 +14,7 @@ import ( io "io" math "math" crew "ultre.me/calcbiz/pkg/crew" + dashboard "ultre.me/calcbiz/pkg/dashboard" soundcloud "ultre.me/calcbiz/pkg/soundcloud" ) @@ -285,114 +286,6 @@ func (m *TpyoEnocdeOuptut) GetTo() string { return "" } -type DahsboardRandomOutput struct { -} - -func (m *DahsboardRandomOutput) Reset() { *m = DahsboardRandomOutput{} } -func (m *DahsboardRandomOutput) String() string { return proto.CompactTextString(m) } -func (*DahsboardRandomOutput) ProtoMessage() {} -func (*DahsboardRandomOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{6} -} -func (m *DahsboardRandomOutput) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DahsboardRandomOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DahsboardRandomOutput.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DahsboardRandomOutput) XXX_Merge(src proto.Message) { - xxx_messageInfo_DahsboardRandomOutput.Merge(m, src) -} -func (m *DahsboardRandomOutput) XXX_Size() int { - return m.Size() -} -func (m *DahsboardRandomOutput) XXX_DiscardUnknown() { - xxx_messageInfo_DahsboardRandomOutput.DiscardUnknown(m) -} - -var xxx_messageInfo_DahsboardRandomOutput proto.InternalMessageInfo - -type DahsboardOutput struct { -} - -func (m *DahsboardOutput) Reset() { *m = DahsboardOutput{} } -func (m *DahsboardOutput) String() string { return proto.CompactTextString(m) } -func (*DahsboardOutput) ProtoMessage() {} -func (*DahsboardOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{7} -} -func (m *DahsboardOutput) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DahsboardOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DahsboardOutput.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DahsboardOutput) XXX_Merge(src proto.Message) { - xxx_messageInfo_DahsboardOutput.Merge(m, src) -} -func (m *DahsboardOutput) XXX_Size() int { - return m.Size() -} -func (m *DahsboardOutput) XXX_DiscardUnknown() { - xxx_messageInfo_DahsboardOutput.DiscardUnknown(m) -} - -var xxx_messageInfo_DahsboardOutput proto.InternalMessageInfo - -type DashboardOutput struct { -} - -func (m *DashboardOutput) Reset() { *m = DashboardOutput{} } -func (m *DashboardOutput) String() string { return proto.CompactTextString(m) } -func (*DashboardOutput) ProtoMessage() {} -func (*DashboardOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{8} -} -func (m *DashboardOutput) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DashboardOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DashboardOutput.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DashboardOutput) XXX_Merge(src proto.Message) { - xxx_messageInfo_DashboardOutput.Merge(m, src) -} -func (m *DashboardOutput) XXX_Size() int { - return m.Size() -} -func (m *DashboardOutput) XXX_DiscardUnknown() { - xxx_messageInfo_DashboardOutput.DiscardUnknown(m) -} - -var xxx_messageInfo_DashboardOutput proto.InternalMessageInfo - // numberinfo messages type NumberinfoInput struct { Number float32 `protobuf:"fixed32,1,opt,name=number,proto3" json:"number,omitempty"` @@ -402,7 +295,7 @@ func (m *NumberinfoInput) Reset() { *m = NumberinfoInput{} } func (m *NumberinfoInput) String() string { return proto.CompactTextString(m) } func (*NumberinfoInput) ProtoMessage() {} func (*NumberinfoInput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{9} + return fileDescriptor_1b40cafcd4234784, []int{6} } func (m *NumberinfoInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -446,7 +339,7 @@ func (m *NumberinfoOutput) Reset() { *m = NumberinfoOutput{} } func (m *NumberinfoOutput) String() string { return proto.CompactTextString(m) } func (*NumberinfoOutput) ProtoMessage() {} func (*NumberinfoOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{10} + return fileDescriptor_1b40cafcd4234784, []int{7} } func (m *NumberinfoOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -490,7 +383,7 @@ func (m *MoijaimeOutput) Reset() { *m = MoijaimeOutput{} } func (m *MoijaimeOutput) String() string { return proto.CompactTextString(m) } func (*MoijaimeOutput) ProtoMessage() {} func (*MoijaimeOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{11} + return fileDescriptor_1b40cafcd4234784, []int{8} } func (m *MoijaimeOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -534,7 +427,7 @@ func (m *WotdOutput) Reset() { *m = WotdOutput{} } func (m *WotdOutput) String() string { return proto.CompactTextString(m) } func (*WotdOutput) ProtoMessage() {} func (*WotdOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{12} + return fileDescriptor_1b40cafcd4234784, []int{9} } func (m *WotdOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -578,7 +471,7 @@ func (m *AlternateLogoOutput) Reset() { *m = AlternateLogoOutput{} } func (m *AlternateLogoOutput) String() string { return proto.CompactTextString(m) } func (*AlternateLogoOutput) ProtoMessage() {} func (*AlternateLogoOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{13} + return fileDescriptor_1b40cafcd4234784, []int{10} } func (m *AlternateLogoOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -621,7 +514,7 @@ func (m *SpreadshirtRandomOutput) Reset() { *m = SpreadshirtRandomOutput func (m *SpreadshirtRandomOutput) String() string { return proto.CompactTextString(m) } func (*SpreadshirtRandomOutput) ProtoMessage() {} func (*SpreadshirtRandomOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{14} + return fileDescriptor_1b40cafcd4234784, []int{11} } func (m *SpreadshirtRandomOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -657,7 +550,7 @@ func (m *SpreadshirtAllOutput) Reset() { *m = SpreadshirtAllOutput{} } func (m *SpreadshirtAllOutput) String() string { return proto.CompactTextString(m) } func (*SpreadshirtAllOutput) ProtoMessage() {} func (*SpreadshirtAllOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{15} + return fileDescriptor_1b40cafcd4234784, []int{12} } func (m *SpreadshirtAllOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -694,7 +587,7 @@ func (m *SoundcloudPlaylistInput) Reset() { *m = SoundcloudPlaylistInput func (m *SoundcloudPlaylistInput) String() string { return proto.CompactTextString(m) } func (*SoundcloudPlaylistInput) ProtoMessage() {} func (*SoundcloudPlaylistInput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{16} + return fileDescriptor_1b40cafcd4234784, []int{13} } func (m *SoundcloudPlaylistInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -738,7 +631,7 @@ func (m *SoundcloudTrackInput) Reset() { *m = SoundcloudTrackInput{} } func (m *SoundcloudTrackInput) String() string { return proto.CompactTextString(m) } func (*SoundcloudTrackInput) ProtoMessage() {} func (*SoundcloudTrackInput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{17} + return fileDescriptor_1b40cafcd4234784, []int{14} } func (m *SoundcloudTrackInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -785,7 +678,7 @@ func (m *RecettatorInput) Reset() { *m = RecettatorInput{} } func (m *RecettatorInput) String() string { return proto.CompactTextString(m) } func (*RecettatorInput) ProtoMessage() {} func (*RecettatorInput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{18} + return fileDescriptor_1b40cafcd4234784, []int{15} } func (m *RecettatorInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -856,7 +749,7 @@ func (m *RecettatorIngredient) Reset() { *m = RecettatorIngredient{} } func (m *RecettatorIngredient) String() string { return proto.CompactTextString(m) } func (*RecettatorIngredient) ProtoMessage() {} func (*RecettatorIngredient) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{19} + return fileDescriptor_1b40cafcd4234784, []int{16} } func (m *RecettatorIngredient) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -948,7 +841,7 @@ func (m *RecettatorOutput) Reset() { *m = RecettatorOutput{} } func (m *RecettatorOutput) String() string { return proto.CompactTextString(m) } func (*RecettatorOutput) ProtoMessage() {} func (*RecettatorOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_1b40cafcd4234784, []int{20} + return fileDescriptor_1b40cafcd4234784, []int{17} } func (m *RecettatorOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1033,9 +926,6 @@ func init() { proto.RegisterType((*KryptosOutput)(nil), "calcbiz.server.KryptosOutput") proto.RegisterType((*TpyoEnocdeIpunt)(nil), "calcbiz.server.TpyoEnocdeIpunt") proto.RegisterType((*TpyoEnocdeOuptut)(nil), "calcbiz.server.TpyoEnocdeOuptut") - proto.RegisterType((*DahsboardRandomOutput)(nil), "calcbiz.server.DahsboardRandomOutput") - proto.RegisterType((*DahsboardOutput)(nil), "calcbiz.server.DahsboardOutput") - proto.RegisterType((*DashboardOutput)(nil), "calcbiz.server.DashboardOutput") proto.RegisterType((*NumberinfoInput)(nil), "calcbiz.server.NumberinfoInput") proto.RegisterType((*NumberinfoOutput)(nil), "calcbiz.server.NumberinfoOutput") proto.RegisterMapType((map[string]string)(nil), "calcbiz.server.NumberinfoOutput.FactsEntry") @@ -1054,87 +944,87 @@ func init() { func init() { proto.RegisterFile("api/api.proto", fileDescriptor_1b40cafcd4234784) } var fileDescriptor_1b40cafcd4234784 = []byte{ - // 1278 bytes of a gzipped FileDescriptorProto + // 1275 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x41, 0x6f, 0x13, 0xc7, - 0x17, 0x67, 0x1d, 0x27, 0x24, 0x0f, 0x62, 0x3b, 0x93, 0x4d, 0xe2, 0x2c, 0xc1, 0x09, 0x03, 0xff, - 0x3f, 0x84, 0x0a, 0x5b, 0x85, 0x0b, 0xe2, 0x96, 0x42, 0x2a, 0x45, 0x94, 0x42, 0x0d, 0x2d, 0x2a, - 0x97, 0x68, 0xe3, 0x9d, 0xac, 0x17, 0xef, 0xce, 0x2c, 0xb3, 0xb3, 0x44, 0x2e, 0xca, 0xa5, 0xe7, - 0x4a, 0xad, 0xd4, 0x63, 0xbf, 0x45, 0xbf, 0x42, 0x2f, 0x3d, 0xa2, 0x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0x7a, 0xf7, + 0xc9, 0x7f, 0xa6, 0xe7, 0x91, 0x42, 0x8f, 0x00, 0x98, 0xa7, 0x18, 0x6d, 0x95, 0xd9, 0x4a, 0xaf, + 0xb9, 0xb3, 0x5d, 0x0d, 0xd0, 0xef, 0x38, 0xb6, 0x95, 0x62, 0x03, 0x2f, 0x29, 0x45, 0x11, 0x8f, + 0x99, 0x94, 0xd9, 0x83, 0xfa, 0xe3, 0x80, 0xfa, 0xc8, 0x2e, 0xef, 0x97, 0x7d, 0xc9, 0x99, 0x8a, + 0xca, 0x2e, 0x85, 0x57, 0x14, 0xd3, 0x39, 0xa4, 0x99, 0x62, 0xb9, 0xfd, 0x19, 0x2c, 0xdd, 0xcf, + 0x9b, 0x5f, 0x05, 0x97, 0x53, 0x44, 0x4d, 0x9b, 0x94, 0x0f, 0x78, 0x40, 0x12, 0xbc, 0xa6, 0x18, + 0x5b, 0xa8, 0xa1, 0x18, 0x8b, 0x75, 0x74, 0x0f, 0xea, 0xf7, 0x38, 0x39, 0xae, 0x60, 0x44, 0x45, + 0x54, 0xb5, 0x64, 0x89, 0x2c, 0xe5, 0x26, 0xe3, 0xe8, 0x15, 0x80, 0xe9, 0x29, 0xd3, 0x27, 0x59, + 0x6a, 0x66, 0xd3, 0x27, 0x59, 0x6e, 0x48, 0x78, 0x5b, 0x69, 0x38, 0xa8, 0xad, 0x34, 0x68, 0xb1, + 0xdc, 0x7b, 0xa3, 0xed, 0x13, 0x34, 0x04, 0x30, 0x95, 0x3e, 0x2d, 0x59, 0x7a, 0x6a, 0xa7, 0x25, + 0xcb, 0x0f, 0x03, 0x5e, 0x57, 0x92, 0x2b, 0xa8, 0xa9, 0x24, 0xb9, 0xe1, 0x7e, 0x0e, 0x8b, 0x79, + 0x43, 0xab, 0x38, 0xa5, 0x4e, 0x39, 0x7a, 0xba, 0x01, 0xe2, 0x0b, 0x8a, 0xba, 0x89, 0x96, 0x15, + 0x75, 0x94, 0x93, 0x25, 0xb0, 0x32, 0xd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xb4, 0x56, + 0x96, 0x15, 0x9a, 0xf1, 0x04, 0x9a, 0x25, 0x15, 0x74, 0xb5, 0xfa, 0x83, 0xcd, 0xf4, 0xe6, 0x6c, + 0x54, 0x8a, 0xe2, 0x1d, 0xa5, 0x79, 0x05, 0x5d, 0x9e, 0xad, 0xd9, 0x7b, 0x93, 0x8f, 0x7d, 0x27, + 0x9f, 0x75, 0x7f, 0x7b, 0xd7, 0xb1, 0xde, 0xbe, 0xeb, 0x58, 0x7f, 0xbd, 0xeb, 0x58, 0x3f, 0xbe, + 0xef, 0x9c, 0x79, 0xfb, 0xbe, 0x73, 0xe6, 0xcf, 0xf7, 0x9d, 0x33, 0x2f, 0xec, 0x34, 0x14, 0x9c, + 0x74, 0x23, 0xd2, 0xcb, 0x74, 0x24, 0xd9, 0xe1, 0x82, 0xfa, 0x3f, 0xe5, 0xf6, 0x3f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xad, 0xf7, 0x4b, 0xe9, 0x6a, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1153,7 +1043,7 @@ type ServerClient interface { KryptosDecrypt(ctx context.Context, in *KryptosInput, opts ...grpc.CallOption) (*KryptosOutput, error) TpyoEnocde(ctx context.Context, in *TpyoEnocdeIpunt, opts ...grpc.CallOption) (*TpyoEnocdeOuptut, error) Ping(ctx context.Context, in *Void, opts ...grpc.CallOption) (*Pong, error) - Dashboard(ctx context.Context, in *Void, opts ...grpc.CallOption) (*DashboardOutput, error) + Dashboard(ctx context.Context, in *Void, opts ...grpc.CallOption) (*dashboard.Entries, error) Crew(ctx context.Context, in *Void, opts ...grpc.CallOption) (*crew.Crew, error) Numberinfo(ctx context.Context, in *NumberinfoInput, opts ...grpc.CallOption) (*NumberinfoOutput, error) Recettator(ctx context.Context, in *RecettatorInput, opts ...grpc.CallOption) (*RecettatorOutput, error) @@ -1213,8 +1103,8 @@ func (c *serverClient) Ping(ctx context.Context, in *Void, opts ...grpc.CallOpti return out, nil } -func (c *serverClient) Dashboard(ctx context.Context, in *Void, opts ...grpc.CallOption) (*DashboardOutput, error) { - out := new(DashboardOutput) +func (c *serverClient) Dashboard(ctx context.Context, in *Void, opts ...grpc.CallOption) (*dashboard.Entries, error) { + out := new(dashboard.Entries) err := c.cc.Invoke(ctx, "/calcbiz.server.Server/Dashboard", in, out, opts...) if err != nil { return nil, err @@ -1345,7 +1235,7 @@ type ServerServer interface { KryptosDecrypt(context.Context, *KryptosInput) (*KryptosOutput, error) TpyoEnocde(context.Context, *TpyoEnocdeIpunt) (*TpyoEnocdeOuptut, error) Ping(context.Context, *Void) (*Pong, error) - Dashboard(context.Context, *Void) (*DashboardOutput, error) + Dashboard(context.Context, *Void) (*dashboard.Entries, error) Crew(context.Context, *Void) (*crew.Crew, error) Numberinfo(context.Context, *NumberinfoInput) (*NumberinfoOutput, error) Recettator(context.Context, *RecettatorInput) (*RecettatorOutput, error) @@ -1908,60 +1798,6 @@ func (m *TpyoEnocdeOuptut) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *DahsboardRandomOutput) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DahsboardRandomOutput) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *DahsboardOutput) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DahsboardOutput) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - -func (m *DashboardOutput) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DashboardOutput) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - func (m *NumberinfoInput) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2448,33 +2284,6 @@ func (m *TpyoEnocdeOuptut) Size() (n int) { return n } -func (m *DahsboardRandomOutput) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *DahsboardOutput) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *DashboardOutput) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *NumberinfoInput) Size() (n int) { if m == nil { return 0 @@ -3143,156 +2952,6 @@ func (m *TpyoEnocdeOuptut) Unmarshal(dAtA []byte) error { } return nil } -func (m *DahsboardRandomOutput) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DahsboardRandomOutput: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DahsboardRandomOutput: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DahsboardOutput) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DahsboardOutput: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DahsboardOutput: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DashboardOutput) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DashboardOutput: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DashboardOutput: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *NumberinfoInput) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/api/api.proto b/api/api.proto index 3787a89e..45d28866 100644 --- a/api/api.proto +++ b/api/api.proto @@ -6,6 +6,7 @@ import "google/api/annotations.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; //import "google/protobuf/timestamp.proto"; import "pkg/crew/crew.proto"; +import "pkg/dashboard/dashboard.proto"; import "pkg/soundcloud/soundcloud.proto"; option go_package = "ultre.me/calcbiz/api"; @@ -33,7 +34,7 @@ service Server { }; } rpc Ping(Void) returns (Pong) { option (google.api.http) = { get: "/api/ping" }; }; - rpc Dashboard(Void) returns (DashboardOutput) { option (google.api.http) = {get: "/api/dashboard"}; } + rpc Dashboard(Void) returns (calcbiz.dashboard.Entries) { option (google.api.http) = {get: "/api/dashboard"}; } rpc Crew(Void) returns (calcbiz.crew.Crew) { option (google.api.http) = {get: "/api/crew"}; } rpc Numberinfo(NumberinfoInput) returns (NumberinfoOutput) { option (google.api.http) = {get: "/api/numberinfo/{number}"}; } rpc Recettator(RecettatorInput) returns (RecettatorOutput) { option (google.api.http) = {get: "/api/recettator"}; } @@ -71,12 +72,6 @@ message KryptosOutput { string to = 1; } message TpyoEnocdeIpunt { string form = 1; } message TpyoEnocdeOuptut { string to = 1; } -// dashboard messages - -message DahsboardRandomOutput { /* TODO */ } -message DahsboardOutput { /* TODO */ } -message DashboardOutput { /* TODO */ } - // numberinfo messages message NumberinfoInput { float number = 1; } message NumberinfoOutput { map facts = 1; } diff --git a/go.mod b/go.mod index fee8209c..2c0954f4 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/gogo/protobuf v1.2.0 github.com/golang/protobuf v1.2.0 github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect + github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/handlers v1.4.0 github.com/gorilla/mux v1.6.2 github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190104160321-4832df01553a @@ -21,7 +22,7 @@ require ( github.com/sirupsen/logrus v1.3.0 // indirect github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect - github.com/tdewolff/minify v2.3.6+incompatible + github.com/tdewolff/minify v2.3.6+incompatible // indirect github.com/tdewolff/minify/v2 v2.3.8 github.com/tdewolff/parse v2.3.4+incompatible // indirect github.com/tpyolang/tpyo-cli v1.0.0 diff --git a/go.sum b/go.sum index 12fa094c..ab41afe8 100644 --- a/go.sum +++ b/go.sum @@ -196,6 +196,7 @@ github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.4.0 h1:XulKRWSQK5uChr4pEgSE4Tc/OcmnU9GJuSwdog/tZsA= github.com/gorilla/handlers v1.4.0/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= diff --git a/main.go b/main.go index f1092613..ece53ba5 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,8 @@ import ( "ultre.me/calcbiz/views" ) +// FIXME: handle context cancel (when client aborts a request) + // VERSION represents the version of the Camembert au lait crew's website const VERSION = "2.1.0" diff --git a/pkg/dashboard/dashboard.go b/pkg/dashboard/dashboard.go index 7f361b9b..459af543 100644 --- a/pkg/dashboard/dashboard.go +++ b/pkg/dashboard/dashboard.go @@ -4,66 +4,91 @@ import ( "fmt" "math/rand" + "go.uber.org/zap" "ultre.me/calcbiz/pkg/soundcloud" "ultre.me/calcbiz/pkg/spreadshirt" ) -type CALCDashboard struct { - soundcloud *soundcloud.Soundcloud +func (e *Entries) append(entries ...*Entry) { + for _, entry := range entries { + e.Entries = append(e.Entries, entry) + } } -const ( - typeHack = "hack" - typeTrack = "track" - typeMerch = "merch" -) +func NewManualEntry(title, URL, imageURL, description string, kind Entry_Kind) *Entry { + return &Entry{ + Title: title, + URL: URL, + Description: description, + ImageURL: imageURL, + Kind: kind, + } +} -func New() *CALCDashboard { - return &CALCDashboard{} +func (e *Entries) shuffle() { + for i := range e.Entries { + j := rand.Intn(i + 1) + e.Entries[i], e.Entries[j] = e.Entries[j], e.Entries[i] + } } -func (d *CALCDashboard) SetSoundCloud(soundcloud *soundcloud.Soundcloud) { - d.soundcloud = soundcloud +type Options struct { + Soundcloud *soundcloud.Soundcloud } -func (d *CALCDashboard) hackEntries(limit int) (Entries, error) { - entries := Entries{} - entries.append(NewManualEntry(typeHack, "Moi j'aime", "hackz/moijaime", "", "Générateur de phrase de moi j'aime")) - entries.append(NewManualEntry(typeHack, "3615cryptage", "hackz/3615cryptage", "", "Messages codés de James Bond")) +type Dashboard struct{ opts *Options } + +func New(opts *Options) *Dashboard { return &Dashboard{opts: opts} } + +func newEntries() *Entries { + return &Entries{Entries: make([]*Entry, 0)} +} + +func (d *Dashboard) hackEntries(limit int) (*Entries, error) { + entries := newEntries() + entries.append(NewManualEntry("Moi j'aime", "hackz/moijaime", "", "Générateur de phrase de moi j'aime", Entry_Hack)) + entries.append(NewManualEntry("3615cryptage", "hackz/3615cryptage", "", "Messages codés de James Bond", Entry_Hack)) entries.shuffle() - if len(entries) < limit { - limit = len(entries) + if len(entries.Entries) < limit { + limit = len(entries.Entries) } - return entries[:limit], nil + entries.Entries = entries.Entries[:limit] + return entries, nil } -func (d *CALCDashboard) trackEntries(limit int) (Entries, error) { - entries := Entries{} +func (d *Dashboard) trackEntries(limit int) (*Entries, error) { + entries := newEntries() - tracks, err := d.soundcloud.Tracks() + tracks, err := d.opts.Soundcloud.GetTracks() if err != nil { return entries, err } - if len(tracks) < limit { - limit = len(tracks) + if len(tracks.Tracks) < limit { + limit = len(tracks.Tracks) } // shuffle tracks - for i := range tracks { + for i := range tracks.Tracks { j := rand.Intn(i + 1) - tracks[i], tracks[j] = tracks[j], tracks[i] + tracks.Tracks[i], tracks.Tracks[j] = tracks.Tracks[j], tracks.Tracks[i] } - for _, track := range tracks[:limit] { - entries.append(NewManualEntry(typeTrack, track.Title, fmt.Sprintf("track/%d", track.Id), track.ArtworkUrl, track.Description)) + for _, track := range tracks.Tracks[:limit] { + entries.append(NewManualEntry( + track.Title, + fmt.Sprintf("track/%d", track.ID), + track.ArtworkUrl, + track.Description, + Entry_Track, + )) } entries.shuffle() return entries, nil } -func (d *CALCDashboard) merchEntries(limit int) (Entries, error) { +func (d *Dashboard) merchEntries(limit int) (Entries, error) { entries := Entries{} products := spreadshirt.GetAllProducts(250, 250) @@ -71,34 +96,65 @@ func (d *CALCDashboard) merchEntries(limit int) (Entries, error) { limit = len(products) } for _, product := range products[:limit] { - entries.append(NewManualEntry(typeMerch, product.Title, product.URL, product.ImageURL, "")) + entries.append(NewManualEntry( + product.Title, + product.URL, + product.ImageURL, + "", + Entry_Merch, + )) } entries.shuffle() return entries, nil } -func (d *CALCDashboard) Random() (Entries, error) { - entries := Entries{} +func (d *Dashboard) Random() (*Entries, error) { + entries := newEntries() + globalLimit := 16 + + // FIXME: parallelize slow calls + + // + // hacks + // hacks, err := d.hackEntries(3) if err != nil { return nil, err } - entries = append(entries, hacks...) + entries.append(hacks.Entries...) + zap.L().Debug("fetched hack entries", zap.Int("len", len(hacks.Entries))) + // + // tracks (soundcloud) + // + // FIXME: add timeout tracks, err := d.trackEntries(11) if err != nil { return nil, err } - entries = append(entries, tracks...) + zap.L().Debug("fetched tracks entries", zap.Int("len", len(tracks.Entries))) + entries.append(tracks.Entries...) + // + // merch + // + // FIXME: add timeout merchs, err := d.merchEntries(2) if err != nil { return nil, err } - entries = append(entries, merchs...) + zap.L().Debug("fetched merch entries", zap.Int("len", len(merchs.Entries))) + entries.append(merchs.Entries...) + // shuffle the compilation entries.shuffle() + + // ensure we have exactly `globalLimit` entries + for len(entries.Entries) < globalLimit { + entries.Entries = append(entries.Entries, entries.Entries...) + } + entries.Entries = entries.Entries[:globalLimit] return entries, nil } diff --git a/pkg/dashboard/dashboard.pb.go b/pkg/dashboard/dashboard.pb.go new file mode 100644 index 00000000..7a41fa09 --- /dev/null +++ b/pkg/dashboard/dashboard.pb.go @@ -0,0 +1,723 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/dashboard/dashboard.proto + +package dashboard + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + io "io" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +type Entry_Kind int32 + +const ( + Entry_Undefined Entry_Kind = 0 + Entry_Hack Entry_Kind = 1 + Entry_Track Entry_Kind = 2 + Entry_Merch Entry_Kind = 3 +) + +var Entry_Kind_name = map[int32]string{ + 0: "Undefined", + 1: "Hack", + 2: "Track", + 3: "Merch", +} + +var Entry_Kind_value = map[string]int32{ + "Undefined": 0, + "Hack": 1, + "Track": 2, + "Merch": 3, +} + +func (x Entry_Kind) String() string { + return proto.EnumName(Entry_Kind_name, int32(x)) +} + +func (Entry_Kind) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_86c4470626934ef2, []int{1, 0} +} + +type Entries struct { + Entries []*Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (m *Entries) Reset() { *m = Entries{} } +func (m *Entries) String() string { return proto.CompactTextString(m) } +func (*Entries) ProtoMessage() {} +func (*Entries) Descriptor() ([]byte, []int) { + return fileDescriptor_86c4470626934ef2, []int{0} +} +func (m *Entries) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Entries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Entries.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Entries) XXX_Merge(src proto.Message) { + xxx_messageInfo_Entries.Merge(m, src) +} +func (m *Entries) XXX_Size() int { + return m.Size() +} +func (m *Entries) XXX_DiscardUnknown() { + xxx_messageInfo_Entries.DiscardUnknown(m) +} + +var xxx_messageInfo_Entries proto.InternalMessageInfo + +func (m *Entries) GetEntries() []*Entry { + if m != nil { + return m.Entries + } + return nil +} + +type Entry struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + URL string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + ImageURL string `protobuf:"bytes,4,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"` + Kind Entry_Kind `protobuf:"varint,5,opt,name=kind,proto3,enum=calcbiz.dashboard.Entry_Kind" json:"kind,omitempty"` +} + +func (m *Entry) Reset() { *m = Entry{} } +func (m *Entry) String() string { return proto.CompactTextString(m) } +func (*Entry) ProtoMessage() {} +func (*Entry) Descriptor() ([]byte, []int) { + return fileDescriptor_86c4470626934ef2, []int{1} +} +func (m *Entry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Entry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Entry) XXX_Merge(src proto.Message) { + xxx_messageInfo_Entry.Merge(m, src) +} +func (m *Entry) XXX_Size() int { + return m.Size() +} +func (m *Entry) XXX_DiscardUnknown() { + xxx_messageInfo_Entry.DiscardUnknown(m) +} + +var xxx_messageInfo_Entry proto.InternalMessageInfo + +func (m *Entry) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Entry) GetURL() string { + if m != nil { + return m.URL + } + return "" +} + +func (m *Entry) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Entry) GetImageURL() string { + if m != nil { + return m.ImageURL + } + return "" +} + +func (m *Entry) GetKind() Entry_Kind { + if m != nil { + return m.Kind + } + return Entry_Undefined +} + +func init() { + proto.RegisterEnum("calcbiz.dashboard.Entry_Kind", Entry_Kind_name, Entry_Kind_value) + proto.RegisterType((*Entries)(nil), "calcbiz.dashboard.Entries") + proto.RegisterType((*Entry)(nil), "calcbiz.dashboard.Entry") +} + +func init() { proto.RegisterFile("pkg/dashboard/dashboard.proto", fileDescriptor_86c4470626934ef2) } + +var fileDescriptor_86c4470626934ef2 = []byte{ + // 363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x3d, 0x4f, 0xe3, 0x30, + 0x1c, 0xc6, 0xe3, 0x26, 0xb9, 0x36, 0xee, 0xdd, 0xa9, 0x67, 0xdd, 0x90, 0xab, 0xae, 0x69, 0xd4, + 0xa9, 0x0c, 0x24, 0xa2, 0x08, 0x89, 0x85, 0xa5, 0x12, 0x12, 0x08, 0x58, 0x22, 0xba, 0xb0, 0x20, + 0x27, 0x71, 0x53, 0xab, 0xa9, 0x1d, 0x39, 0xce, 0x00, 0x9f, 0x82, 0x8f, 0xc5, 0xd8, 0x91, 0xa9, + 0x42, 0xe9, 0x07, 0xe0, 0x2b, 0x20, 0x3b, 0xbc, 0x0a, 0xb1, 0x3d, 0xcf, 0xef, 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, 0xfc, 0x7b, 0x32, 0xf8, 0xee, 0xf0, 0xe0, 0x8c, 0xb2, 0x34, 0xd2, + 0xd1, 0xd1, 0x01, 0xb4, 0x94, 0x43, 0xbf, 0xa0, 0x33, 0x63, 0x29, 0x99, 0x53, 0x46, 0xd2, 0x9e, + 0x81, 0x3a, 0xd0, 0x3a, 0xc1, 0xc9, 0xb2, 0x07, 0x90, 0x03, 0xed, 0x4b, 0xa1, 0x64, 0x4b, 0xc9, + 0x0b, 0x22, 0x92, 0x45, 0xcf, 0x9c, 0x1e, 0xde, 0xd7, 0x1e, 0x58, 0xd7, 0x1e, 0x78, 0xac, 0x3d, + 0x70, 0xb7, 0xf5, 0x8c, 0xf5, 0xd6, 0x33, 0x1e, 0xb6, 0x9e, 0x71, 0xe5, 0x55, 0xb9, 0x14, 0x24, + 0x58, 0x91, 0xf0, 0x65, 0x7b, 0xf8, 0xe9, 0x6b, 0xe3, 0x1f, 0xfa, 0xc5, 0xf7, 0x9f, 0x03, 0x00, + 0x00, 0xff, 0xff, 0x48, 0x02, 0x7f, 0x43, 0xf2, 0x01, 0x00, 0x00, +} + +func (m *Entries) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Entries) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Entries) > 0 { + for _, msg := range m.Entries { + dAtA[i] = 0xa + i++ + i = encodeVarintDashboard(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *Entry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Entry) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Title) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintDashboard(dAtA, i, uint64(len(m.Title))) + i += copy(dAtA[i:], m.Title) + } + if len(m.URL) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintDashboard(dAtA, i, uint64(len(m.URL))) + i += copy(dAtA[i:], m.URL) + } + if len(m.Description) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintDashboard(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if len(m.ImageURL) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintDashboard(dAtA, i, uint64(len(m.ImageURL))) + i += copy(dAtA[i:], m.ImageURL) + } + if m.Kind != 0 { + dAtA[i] = 0x28 + i++ + i = encodeVarintDashboard(dAtA, i, uint64(m.Kind)) + } + return i, nil +} + +func encodeVarintDashboard(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *Entries) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovDashboard(uint64(l)) + } + } + return n +} + +func (m *Entry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovDashboard(uint64(l)) + } + l = len(m.URL) + if l > 0 { + n += 1 + l + sovDashboard(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovDashboard(uint64(l)) + } + l = len(m.ImageURL) + if l > 0 { + n += 1 + l + sovDashboard(uint64(l)) + } + if m.Kind != 0 { + n += 1 + sovDashboard(uint64(m.Kind)) + } + return n +} + +func sovDashboard(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozDashboard(x uint64) (n int) { + return sovDashboard(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Entries) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDashboard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Entries: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entries: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDashboard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDashboard + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Entries = append(m.Entries, &Entry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDashboard(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDashboard + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Entry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDashboard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Entry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDashboard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDashboard + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDashboard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDashboard + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDashboard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDashboard + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDashboard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDashboard + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImageURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + m.Kind = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDashboard + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Kind |= (Entry_Kind(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDashboard(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDashboard + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDashboard(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDashboard + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDashboard + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDashboard + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthDashboard + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDashboard + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipDashboard(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthDashboard = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDashboard = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/dashboard/dashboard.proto b/pkg/dashboard/dashboard.proto new file mode 100644 index 00000000..2a018aba --- /dev/null +++ b/pkg/dashboard/dashboard.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package calcbiz.dashboard; + +import "google/api/annotations.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +//import "google/protobuf/timestamp.proto"; + +option go_package = "ultre.me/calcbiz/pkg/dashboard"; +option (gogoproto.sizer_all) = true; +option (gogoproto.marshaler_all) = true; +option (gogoproto.unmarshaler_all) = true; + +message Entries { + repeated Entry entries = 1; +} + +message Entry { + enum Kind { + Undefined = 0; + Hack = 1; + Track = 2; + Merch = 3; + //Album = 4; + //Video = 5; + //Image = 6; + //Playlist = 7; + //Copain = 8; + } + string title = 1; + string url = 2 [(gogoproto.customname) = "URL"]; + string description = 3; + string image_url = 4 [(gogoproto.customname) = "ImageURL"]; + Kind kind = 5; +} diff --git a/pkg/dashboard/entries.go b/pkg/dashboard/entries.go deleted file mode 100644 index 651bf93e..00000000 --- a/pkg/dashboard/entries.go +++ /dev/null @@ -1,70 +0,0 @@ -package calcdashboard - -import "math/rand" - -type Entry interface { - GetMinimalFields() (*MinimalFields, error) -} - -type Entries []Entry - -type MinimalFields struct { - Title string `json:"title"` - URL string `json:"url"` - Description string `json:"description"` - ImageURL string `json:"image-url"` - Kind string `json:"kind"` -} - -func (e *Entries) GetMinimalFields() ([]*MinimalFields, error) { - var results []*MinimalFields - - for _, entry := range *e { - result, err := entry.GetMinimalFields() - if err != nil { - return nil, err - } - results = append(results, result) - } - - return results, nil -} - -func (e *Entries) append(entry Entry) { - *e = append(*e, entry) -} - -type ManualEntry struct { - Title string `json:"title"` - URL string `json:"url"` - Description string `json:"description"` - ImageURL string `json:"image-url"` - Kind string `json:"kind"` -} - -func (m *ManualEntry) GetMinimalFields() (*MinimalFields, error) { - return &MinimalFields{ - Title: m.Title, - URL: m.URL, - Description: m.Description, - ImageURL: m.ImageURL, - Kind: m.Kind, - }, nil -} - -func NewManualEntry(kind, title, URL, imageURL, description string) *ManualEntry { - return &ManualEntry{ - Title: title, - URL: URL, - Description: description, - ImageURL: imageURL, - Kind: kind, - } -} - -func (e *Entries) shuffle() { - for i := range *e { - j := rand.Intn(i + 1) - (*e)[i], (*e)[j] = (*e)[j], (*e)[i] - } -} diff --git a/pkg/soundcloud/soundcloud.go b/pkg/soundcloud/soundcloud.go index a598bdf8..d210f224 100644 --- a/pkg/soundcloud/soundcloud.go +++ b/pkg/soundcloud/soundcloud.go @@ -16,8 +16,8 @@ type Soundcloud struct { cache memoizer.Memoize } -func New(clientID string, userID uint64) Soundcloud { - return Soundcloud{ +func New(clientID string, userID uint64) *Soundcloud { + return &Soundcloud{ client: &gosoundcloud.Api{ ClientId: clientID, }, diff --git a/svc/svc.go b/svc/svc.go index c48646a5..85c2d289 100644 --- a/svc/svc.go +++ b/svc/svc.go @@ -10,6 +10,7 @@ import ( "ultre.me/calcbiz/api" "ultre.me/calcbiz/pkg/crew" + "ultre.me/calcbiz/pkg/dashboard" "ultre.me/calcbiz/pkg/numberinfo" "ultre.me/calcbiz/pkg/random" "ultre.me/calcbiz/pkg/soundcloud" @@ -24,8 +25,8 @@ type Options struct { type svc struct { opts Options - soundcloud soundcloud.Soundcloud - // dashboard + soundcloud *soundcloud.Soundcloud + dashboard *dashboard.Dashboard } func New(opts Options) (api.ServerServer, error) { @@ -34,7 +35,9 @@ func New(opts Options) (api.ServerServer, error) { opts.SoundcloudClientID, uint64(opts.SoundcloudUserID), ) - // svc.dashboard := calcdashboard.New() + svc.dashboard = dashboard.New(&dashboard.Options{ + Soundcloud: svc.soundcloud, + }) // svc.dashboard.SetSoundCloud(&soundcloud) return svc, nil } @@ -62,22 +65,8 @@ func (svc *svc) TpyoEnocde(_ context.Context, input *api.TpyoEnocdeIpunt) (*api. }, nil } -func (svc *svc) Dashboard(_ context.Context, input *api.Void) (*api.DashboardOutput, error) { - /* - r.Get("/dashboard/random", func(w http.ResponseWriter, r *http.Request) { - dashboard, err := dashboard.Random() - if err != nil { - c.JSON(http.StatusNotFound, gin.H{ - "error": err, - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "result": dashboard, - }) - } - }) - */ - return nil, fmt.Errorf("not implemented") +func (svc *svc) Dashboard(_ context.Context, input *api.Void) (*dashboard.Entries, error) { + return svc.dashboard.Random() } func (svc *svc) Crew(_ context.Context, input *api.Void) (*crew.Crew, error) { diff --git a/swagger.yaml b/swagger.yaml index 69c56128..1f07d24a 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -54,7 +54,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/serverDashboardOutput" + "$ref": "#/definitions/dashboardEntries" } } }, @@ -392,6 +392,16 @@ } }, "definitions": { + "EntryKind": { + "type": "string", + "enum": [ + "Undefined", + "Hack", + "Track", + "Merch" + ], + "default": "Undefined" + }, "crewCrew": { "type": "object", "properties": { @@ -486,6 +496,37 @@ } } }, + "dashboardEntries": { + "type": "object", + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/dashboardEntry" + } + } + } + }, + "dashboardEntry": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "image_url": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/EntryKind" + } + } + }, "serverAlternateLogoOutput": { "type": "object", "properties": { @@ -494,9 +535,6 @@ } } }, - "serverDashboardOutput": { - "type": "object" - }, "serverKryptosInput": { "type": "object", "properties": {