Documentation ¶
Overview ¶
Package server is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
generated by generate-grpc-methods; DO NOT EDIT
generated by generate-grpc-methods; DO NOT EDIT
generated by generate-grpc-methods; DO NOT EDIT
Index ¶
- Variables
- func ConvertPlacementUpdateRequestToBannerPlacement(r *PlacementUpdateRequest) structs.BannerPlacement
- func ConvertSimpleUpdateRequestToBanner(r *SimpleUpdateRequest) structs.Banner
- func ConvertSimpleUpdateRequestToGroup(r *SimpleUpdateRequest) structs.Group
- func ConvertSimpleUpdateRequestToSlot(r *SimpleUpdateRequest) structs.Slot
- func ProxyLoggerMiddleware(log *logger.Logger, h http.Handler) http.Handler
- func RegisterBannerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterBannerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BannerClient) error
- func RegisterBannerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterBannerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BannerServer) error
- func RegisterBannerServer(s *grpc.Server, srv BannerServer)
- type BannerClient
- type BannerServer
- type BannerShowRequest
- func (*BannerShowRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BannerShowRequest) GetGroupID() uint64
- func (x *BannerShowRequest) GetSlotID() uint64
- func (*BannerShowRequest) ProtoMessage()
- func (x *BannerShowRequest) ProtoReflect() protoreflect.Message
- func (x *BannerShowRequest) Reset()
- func (x *BannerShowRequest) String() string
- type MultiplePlacementResponse
- func (*MultiplePlacementResponse) Descriptor() ([]byte, []int)deprecated
- func (x *MultiplePlacementResponse) GetObjects() []*PlacementResponse
- func (*MultiplePlacementResponse) ProtoMessage()
- func (x *MultiplePlacementResponse) ProtoReflect() protoreflect.Message
- func (x *MultiplePlacementResponse) Reset()
- func (x *MultiplePlacementResponse) String() string
- type MultipleSimpleResponse
- func (*MultipleSimpleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *MultipleSimpleResponse) GetObjects() []*SimpleResponse
- func (*MultipleSimpleResponse) ProtoMessage()
- func (x *MultipleSimpleResponse) ProtoReflect() protoreflect.Message
- func (x *MultipleSimpleResponse) Reset()
- func (x *MultipleSimpleResponse) String() string
- type PlacementCreateRequest
- func (*PlacementCreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PlacementCreateRequest) GetBannerID() uint64
- func (x *PlacementCreateRequest) GetGroupID() uint64
- func (x *PlacementCreateRequest) GetSlotID() uint64
- func (*PlacementCreateRequest) ProtoMessage()
- func (x *PlacementCreateRequest) ProtoReflect() protoreflect.Message
- func (x *PlacementCreateRequest) Reset()
- func (x *PlacementCreateRequest) String() string
- type PlacementIDsResponse
- func (*PlacementIDsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PlacementIDsResponse) GetBannerID() uint64
- func (x *PlacementIDsResponse) GetGroupID() uint64
- func (x *PlacementIDsResponse) GetID() uint64
- func (x *PlacementIDsResponse) GetSlotID() uint64
- func (*PlacementIDsResponse) ProtoMessage()
- func (x *PlacementIDsResponse) ProtoReflect() protoreflect.Message
- func (x *PlacementIDsResponse) Reset()
- func (x *PlacementIDsResponse) String() string
- type PlacementResponse
- func (*PlacementResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PlacementResponse) GetBanner() *SimpleResponse
- func (x *PlacementResponse) GetClicks() int64
- func (x *PlacementResponse) GetGroup() *SimpleResponse
- func (x *PlacementResponse) GetID() uint64
- func (x *PlacementResponse) GetScore() float64
- func (x *PlacementResponse) GetShows() int64
- func (x *PlacementResponse) GetSlot() *SimpleResponse
- func (*PlacementResponse) ProtoMessage()
- func (x *PlacementResponse) ProtoReflect() protoreflect.Message
- func (x *PlacementResponse) Reset()
- func (x *PlacementResponse) String() string
- type PlacementUpdateRequest
- func (*PlacementUpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PlacementUpdateRequest) GetBannerID() uint64
- func (x *PlacementUpdateRequest) GetClicks() int64
- func (x *PlacementUpdateRequest) GetGroupID() uint64
- func (x *PlacementUpdateRequest) GetID() uint64
- func (x *PlacementUpdateRequest) GetScore() float64
- func (x *PlacementUpdateRequest) GetShows() int64
- func (x *PlacementUpdateRequest) GetSlotID() uint64
- func (*PlacementUpdateRequest) ProtoMessage()
- func (x *PlacementUpdateRequest) ProtoReflect() protoreflect.Message
- func (x *PlacementUpdateRequest) Reset()
- func (x *PlacementUpdateRequest) String() string
- type Server
- func (s Server) BannerClick(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
- func (s Server) BannerShow(ctx context.Context, r *BannerShowRequest) (*PlacementResponse, error)
- func (s Server) Close() error
- func (s Server) CreateBanner(ctx context.Context, r *SimpleCreateRequest) (*SimpleResponse, error)
- func (s Server) CreateGroup(ctx context.Context, r *SimpleCreateRequest) (*SimpleResponse, error)
- func (s Server) CreatePlacement(ctx context.Context, r *PlacementCreateRequest) (*PlacementIDsResponse, error)
- func (s Server) CreateSlot(ctx context.Context, r *SimpleCreateRequest) (*SimpleResponse, error)
- func (s Server) DeleteBanner(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
- func (s Server) DeleteGroup(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
- func (s Server) DeletePlacement(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
- func (s Server) DeleteSlot(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
- func (s Server) ReadBanners(ctx context.Context, empty *empty.Empty) (*MultipleSimpleResponse, error)
- func (s Server) ReadGroups(ctx context.Context, empty *empty.Empty) (*MultipleSimpleResponse, error)
- func (s Server) ReadPlacements(ctx context.Context, empty *empty.Empty) (*MultiplePlacementResponse, error)
- func (s Server) ReadSlots(ctx context.Context, empty *empty.Empty) (*MultipleSimpleResponse, error)
- func (s Server) Run() error
- func (s Server) RunProxy() error
- func (s Server) UpdateBanner(ctx context.Context, r *SimpleUpdateRequest) (*SimpleResponse, error)
- func (s Server) UpdateGroup(ctx context.Context, r *SimpleUpdateRequest) (*SimpleResponse, error)
- func (s Server) UpdatePlacement(ctx context.Context, r *PlacementUpdateRequest) (*PlacementIDsResponse, error)
- func (s Server) UpdateSlot(ctx context.Context, r *SimpleUpdateRequest) (*SimpleResponse, error)
- type SimpleCreateRequest
- func (*SimpleCreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SimpleCreateRequest) GetDescription() string
- func (x *SimpleCreateRequest) GetName() string
- func (*SimpleCreateRequest) ProtoMessage()
- func (x *SimpleCreateRequest) ProtoReflect() protoreflect.Message
- func (x *SimpleCreateRequest) Reset()
- func (x *SimpleCreateRequest) String() string
- type SimpleRequestID
- type SimpleResponse
- func (*SimpleResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SimpleResponse) GetCreatedAt() *timestamp.Timestamp
- func (x *SimpleResponse) GetDescription() string
- func (x *SimpleResponse) GetID() uint64
- func (x *SimpleResponse) GetName() string
- func (x *SimpleResponse) GetUpdatedAt() *timestamp.Timestamp
- func (*SimpleResponse) ProtoMessage()
- func (x *SimpleResponse) ProtoReflect() protoreflect.Message
- func (x *SimpleResponse) Reset()
- func (x *SimpleResponse) String() string
- type SimpleResponseID
- type SimpleUpdateRequest
- func (*SimpleUpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SimpleUpdateRequest) GetDescription() string
- func (x *SimpleUpdateRequest) GetID() uint64
- func (x *SimpleUpdateRequest) GetName() string
- func (*SimpleUpdateRequest) ProtoMessage()
- func (x *SimpleUpdateRequest) ProtoReflect() protoreflect.Message
- func (x *SimpleUpdateRequest) Reset()
- func (x *SimpleUpdateRequest) String() string
- type UnimplementedBannerServer
- func (UnimplementedBannerServer) BannerClick(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
- func (UnimplementedBannerServer) BannerShow(context.Context, *BannerShowRequest) (*PlacementResponse, error)
- func (UnimplementedBannerServer) CreateBanner(context.Context, *SimpleCreateRequest) (*SimpleResponse, error)
- func (UnimplementedBannerServer) CreateGroup(context.Context, *SimpleCreateRequest) (*SimpleResponse, error)
- func (UnimplementedBannerServer) CreatePlacement(context.Context, *PlacementCreateRequest) (*PlacementIDsResponse, error)
- func (UnimplementedBannerServer) CreateSlot(context.Context, *SimpleCreateRequest) (*SimpleResponse, error)
- func (UnimplementedBannerServer) DeleteBanner(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
- func (UnimplementedBannerServer) DeleteGroup(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
- func (UnimplementedBannerServer) DeletePlacement(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
- func (UnimplementedBannerServer) DeleteSlot(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
- func (UnimplementedBannerServer) ReadBanners(context.Context, *empty.Empty) (*MultipleSimpleResponse, error)
- func (UnimplementedBannerServer) ReadGroups(context.Context, *empty.Empty) (*MultipleSimpleResponse, error)
- func (UnimplementedBannerServer) ReadPlacements(context.Context, *empty.Empty) (*MultiplePlacementResponse, error)
- func (UnimplementedBannerServer) ReadSlots(context.Context, *empty.Empty) (*MultipleSimpleResponse, error)
- func (UnimplementedBannerServer) UpdateBanner(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error)
- func (UnimplementedBannerServer) UpdateGroup(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error)
- func (UnimplementedBannerServer) UpdatePlacement(context.Context, *PlacementUpdateRequest) (*PlacementIDsResponse, error)
- func (UnimplementedBannerServer) UpdateSlot(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error)
- type UnsafeBannerServer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ConvertPlacementUpdateRequestToBannerPlacement ¶
func ConvertPlacementUpdateRequestToBannerPlacement(r *PlacementUpdateRequest) structs.BannerPlacement
func ConvertSimpleUpdateRequestToBanner ¶
func ConvertSimpleUpdateRequestToBanner(r *SimpleUpdateRequest) structs.Banner
func ConvertSimpleUpdateRequestToGroup ¶
func ConvertSimpleUpdateRequestToGroup(r *SimpleUpdateRequest) structs.Group
func ConvertSimpleUpdateRequestToSlot ¶
func ConvertSimpleUpdateRequestToSlot(r *SimpleUpdateRequest) structs.Slot
func ProxyLoggerMiddleware ¶
func RegisterBannerHandler ¶
RegisterBannerHandler registers the http handlers for service Banner to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterBannerHandlerClient ¶
func RegisterBannerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BannerClient) error
RegisterBannerHandlerClient registers the http handlers for service Banner to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BannerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BannerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BannerClient" to call the correct interceptors.
func RegisterBannerHandlerFromEndpoint ¶
func RegisterBannerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterBannerHandlerFromEndpoint is same as RegisterBannerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBannerHandlerServer ¶
func RegisterBannerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BannerServer) error
RegisterBannerHandlerServer registers the http handlers for service Banner to "mux". UnaryRPC :call BannerServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterBannerHandlerFromEndpoint instead.
func RegisterBannerServer ¶
func RegisterBannerServer(s *grpc.Server, srv BannerServer)
Types ¶
type BannerClient ¶
type BannerClient interface { // Banner methods. CreateBanner(ctx context.Context, in *SimpleCreateRequest, opts ...grpc.CallOption) (*SimpleResponse, error) ReadBanners(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*MultipleSimpleResponse, error) UpdateBanner(ctx context.Context, in *SimpleUpdateRequest, opts ...grpc.CallOption) (*SimpleResponse, error) DeleteBanner(ctx context.Context, in *SimpleRequestID, opts ...grpc.CallOption) (*SimpleResponseID, error) // Slots methods. CreateSlot(ctx context.Context, in *SimpleCreateRequest, opts ...grpc.CallOption) (*SimpleResponse, error) ReadSlots(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*MultipleSimpleResponse, error) UpdateSlot(ctx context.Context, in *SimpleUpdateRequest, opts ...grpc.CallOption) (*SimpleResponse, error) DeleteSlot(ctx context.Context, in *SimpleRequestID, opts ...grpc.CallOption) (*SimpleResponseID, error) // Group methods. CreateGroup(ctx context.Context, in *SimpleCreateRequest, opts ...grpc.CallOption) (*SimpleResponse, error) ReadGroups(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*MultipleSimpleResponse, error) UpdateGroup(ctx context.Context, in *SimpleUpdateRequest, opts ...grpc.CallOption) (*SimpleResponse, error) DeleteGroup(ctx context.Context, in *SimpleRequestID, opts ...grpc.CallOption) (*SimpleResponseID, error) // Placement methods. CreatePlacement(ctx context.Context, in *PlacementCreateRequest, opts ...grpc.CallOption) (*PlacementIDsResponse, error) ReadPlacements(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*MultiplePlacementResponse, error) UpdatePlacement(ctx context.Context, in *PlacementUpdateRequest, opts ...grpc.CallOption) (*PlacementIDsResponse, error) DeletePlacement(ctx context.Context, in *SimpleRequestID, opts ...grpc.CallOption) (*SimpleResponseID, error) // Banner events methods. BannerShow(ctx context.Context, in *BannerShowRequest, opts ...grpc.CallOption) (*PlacementResponse, error) // pid is PlacementID. BannerClick(ctx context.Context, in *SimpleRequestID, opts ...grpc.CallOption) (*SimpleResponseID, error) }
BannerClient is the client API for Banner service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewBannerClient ¶
func NewBannerClient(cc grpc.ClientConnInterface) BannerClient
type BannerServer ¶
type BannerServer interface { // Banner methods. CreateBanner(context.Context, *SimpleCreateRequest) (*SimpleResponse, error) ReadBanners(context.Context, *empty.Empty) (*MultipleSimpleResponse, error) UpdateBanner(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error) DeleteBanner(context.Context, *SimpleRequestID) (*SimpleResponseID, error) // Slots methods. CreateSlot(context.Context, *SimpleCreateRequest) (*SimpleResponse, error) ReadSlots(context.Context, *empty.Empty) (*MultipleSimpleResponse, error) UpdateSlot(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error) DeleteSlot(context.Context, *SimpleRequestID) (*SimpleResponseID, error) // Group methods. CreateGroup(context.Context, *SimpleCreateRequest) (*SimpleResponse, error) ReadGroups(context.Context, *empty.Empty) (*MultipleSimpleResponse, error) UpdateGroup(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error) DeleteGroup(context.Context, *SimpleRequestID) (*SimpleResponseID, error) // Placement methods. CreatePlacement(context.Context, *PlacementCreateRequest) (*PlacementIDsResponse, error) ReadPlacements(context.Context, *empty.Empty) (*MultiplePlacementResponse, error) UpdatePlacement(context.Context, *PlacementUpdateRequest) (*PlacementIDsResponse, error) DeletePlacement(context.Context, *SimpleRequestID) (*SimpleResponseID, error) // Banner events methods. BannerShow(context.Context, *BannerShowRequest) (*PlacementResponse, error) // pid is PlacementID. BannerClick(context.Context, *SimpleRequestID) (*SimpleResponseID, error) }
BannerServer is the server API for Banner service. All implementations should embed UnimplementedBannerServer for forward compatibility
type BannerShowRequest ¶
type BannerShowRequest struct { SlotID uint64 `protobuf:"varint,1,opt,name=SlotID,proto3" json:"SlotID,omitempty"` GroupID uint64 `protobuf:"varint,2,opt,name=GroupID,proto3" json:"GroupID,omitempty"` // contains filtered or unexported fields }
func (*BannerShowRequest) Descriptor
deprecated
func (*BannerShowRequest) Descriptor() ([]byte, []int)
Deprecated: Use BannerShowRequest.ProtoReflect.Descriptor instead.
func (*BannerShowRequest) GetGroupID ¶
func (x *BannerShowRequest) GetGroupID() uint64
func (*BannerShowRequest) GetSlotID ¶
func (x *BannerShowRequest) GetSlotID() uint64
func (*BannerShowRequest) ProtoMessage ¶
func (*BannerShowRequest) ProtoMessage()
func (*BannerShowRequest) ProtoReflect ¶
func (x *BannerShowRequest) ProtoReflect() protoreflect.Message
func (*BannerShowRequest) Reset ¶
func (x *BannerShowRequest) Reset()
func (*BannerShowRequest) String ¶
func (x *BannerShowRequest) String() string
type MultiplePlacementResponse ¶
type MultiplePlacementResponse struct { Objects []*PlacementResponse `protobuf:"bytes,1,rep,name=Objects,proto3" json:"Objects,omitempty"` // contains filtered or unexported fields }
func (*MultiplePlacementResponse) Descriptor
deprecated
func (*MultiplePlacementResponse) Descriptor() ([]byte, []int)
Deprecated: Use MultiplePlacementResponse.ProtoReflect.Descriptor instead.
func (*MultiplePlacementResponse) GetObjects ¶
func (x *MultiplePlacementResponse) GetObjects() []*PlacementResponse
func (*MultiplePlacementResponse) ProtoMessage ¶
func (*MultiplePlacementResponse) ProtoMessage()
func (*MultiplePlacementResponse) ProtoReflect ¶
func (x *MultiplePlacementResponse) ProtoReflect() protoreflect.Message
func (*MultiplePlacementResponse) Reset ¶
func (x *MultiplePlacementResponse) Reset()
func (*MultiplePlacementResponse) String ¶
func (x *MultiplePlacementResponse) String() string
type MultipleSimpleResponse ¶
type MultipleSimpleResponse struct { Objects []*SimpleResponse `protobuf:"bytes,1,rep,name=Objects,proto3" json:"Objects,omitempty"` // contains filtered or unexported fields }
func (*MultipleSimpleResponse) Descriptor
deprecated
func (*MultipleSimpleResponse) Descriptor() ([]byte, []int)
Deprecated: Use MultipleSimpleResponse.ProtoReflect.Descriptor instead.
func (*MultipleSimpleResponse) GetObjects ¶
func (x *MultipleSimpleResponse) GetObjects() []*SimpleResponse
func (*MultipleSimpleResponse) ProtoMessage ¶
func (*MultipleSimpleResponse) ProtoMessage()
func (*MultipleSimpleResponse) ProtoReflect ¶
func (x *MultipleSimpleResponse) ProtoReflect() protoreflect.Message
func (*MultipleSimpleResponse) Reset ¶
func (x *MultipleSimpleResponse) Reset()
func (*MultipleSimpleResponse) String ¶
func (x *MultipleSimpleResponse) String() string
type PlacementCreateRequest ¶
type PlacementCreateRequest struct { BannerID uint64 `protobuf:"varint,1,opt,name=BannerID,proto3" json:"BannerID,omitempty"` SlotID uint64 `protobuf:"varint,2,opt,name=SlotID,proto3" json:"SlotID,omitempty"` GroupID uint64 `protobuf:"varint,3,opt,name=GroupID,proto3" json:"GroupID,omitempty"` // contains filtered or unexported fields }
func (*PlacementCreateRequest) Descriptor
deprecated
func (*PlacementCreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use PlacementCreateRequest.ProtoReflect.Descriptor instead.
func (*PlacementCreateRequest) GetBannerID ¶
func (x *PlacementCreateRequest) GetBannerID() uint64
func (*PlacementCreateRequest) GetGroupID ¶
func (x *PlacementCreateRequest) GetGroupID() uint64
func (*PlacementCreateRequest) GetSlotID ¶
func (x *PlacementCreateRequest) GetSlotID() uint64
func (*PlacementCreateRequest) ProtoMessage ¶
func (*PlacementCreateRequest) ProtoMessage()
func (*PlacementCreateRequest) ProtoReflect ¶
func (x *PlacementCreateRequest) ProtoReflect() protoreflect.Message
func (*PlacementCreateRequest) Reset ¶
func (x *PlacementCreateRequest) Reset()
func (*PlacementCreateRequest) String ¶
func (x *PlacementCreateRequest) String() string
type PlacementIDsResponse ¶
type PlacementIDsResponse struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` BannerID uint64 `protobuf:"varint,2,opt,name=BannerID,proto3" json:"BannerID,omitempty"` SlotID uint64 `protobuf:"varint,3,opt,name=SlotID,proto3" json:"SlotID,omitempty"` GroupID uint64 `protobuf:"varint,4,opt,name=GroupID,proto3" json:"GroupID,omitempty"` // contains filtered or unexported fields }
func ConvertBannerPlacementToPlacementIDsResponse ¶
func ConvertBannerPlacementToPlacementIDsResponse(p structs.BannerPlacement) *PlacementIDsResponse
func (*PlacementIDsResponse) Descriptor
deprecated
func (*PlacementIDsResponse) Descriptor() ([]byte, []int)
Deprecated: Use PlacementIDsResponse.ProtoReflect.Descriptor instead.
func (*PlacementIDsResponse) GetBannerID ¶
func (x *PlacementIDsResponse) GetBannerID() uint64
func (*PlacementIDsResponse) GetGroupID ¶
func (x *PlacementIDsResponse) GetGroupID() uint64
func (*PlacementIDsResponse) GetID ¶
func (x *PlacementIDsResponse) GetID() uint64
func (*PlacementIDsResponse) GetSlotID ¶
func (x *PlacementIDsResponse) GetSlotID() uint64
func (*PlacementIDsResponse) ProtoMessage ¶
func (*PlacementIDsResponse) ProtoMessage()
func (*PlacementIDsResponse) ProtoReflect ¶
func (x *PlacementIDsResponse) ProtoReflect() protoreflect.Message
func (*PlacementIDsResponse) Reset ¶
func (x *PlacementIDsResponse) Reset()
func (*PlacementIDsResponse) String ¶
func (x *PlacementIDsResponse) String() string
type PlacementResponse ¶
type PlacementResponse struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` Banner *SimpleResponse `protobuf:"bytes,2,opt,name=Banner,proto3" json:"Banner,omitempty"` Slot *SimpleResponse `protobuf:"bytes,3,opt,name=Slot,proto3" json:"Slot,omitempty"` Group *SimpleResponse `protobuf:"bytes,4,opt,name=Group,proto3" json:"Group,omitempty"` Shows int64 `protobuf:"varint,5,opt,name=Shows,proto3" json:"Shows,omitempty"` Clicks int64 `protobuf:"varint,6,opt,name=Clicks,proto3" json:"Clicks,omitempty"` Score float64 `protobuf:"fixed64,7,opt,name=Score,proto3" json:"Score,omitempty"` // contains filtered or unexported fields }
func ConvertBannerPlacementToPlacementResponse ¶
func ConvertBannerPlacementToPlacementResponse(p structs.BannerPlacement) *PlacementResponse
func (*PlacementResponse) Descriptor
deprecated
func (*PlacementResponse) Descriptor() ([]byte, []int)
Deprecated: Use PlacementResponse.ProtoReflect.Descriptor instead.
func (*PlacementResponse) GetBanner ¶
func (x *PlacementResponse) GetBanner() *SimpleResponse
func (*PlacementResponse) GetClicks ¶
func (x *PlacementResponse) GetClicks() int64
func (*PlacementResponse) GetGroup ¶
func (x *PlacementResponse) GetGroup() *SimpleResponse
func (*PlacementResponse) GetID ¶
func (x *PlacementResponse) GetID() uint64
func (*PlacementResponse) GetScore ¶
func (x *PlacementResponse) GetScore() float64
func (*PlacementResponse) GetShows ¶
func (x *PlacementResponse) GetShows() int64
func (*PlacementResponse) GetSlot ¶
func (x *PlacementResponse) GetSlot() *SimpleResponse
func (*PlacementResponse) ProtoMessage ¶
func (*PlacementResponse) ProtoMessage()
func (*PlacementResponse) ProtoReflect ¶
func (x *PlacementResponse) ProtoReflect() protoreflect.Message
func (*PlacementResponse) Reset ¶
func (x *PlacementResponse) Reset()
func (*PlacementResponse) String ¶
func (x *PlacementResponse) String() string
type PlacementUpdateRequest ¶
type PlacementUpdateRequest struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` BannerID uint64 `protobuf:"varint,2,opt,name=BannerID,proto3" json:"BannerID,omitempty"` SlotID uint64 `protobuf:"varint,3,opt,name=SlotID,proto3" json:"SlotID,omitempty"` GroupID uint64 `protobuf:"varint,4,opt,name=GroupID,proto3" json:"GroupID,omitempty"` Shows int64 `protobuf:"varint,5,opt,name=Shows,proto3" json:"Shows,omitempty"` Clicks int64 `protobuf:"varint,6,opt,name=Clicks,proto3" json:"Clicks,omitempty"` Score float64 `protobuf:"fixed64,7,opt,name=Score,proto3" json:"Score,omitempty"` // contains filtered or unexported fields }
func (*PlacementUpdateRequest) Descriptor
deprecated
func (*PlacementUpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use PlacementUpdateRequest.ProtoReflect.Descriptor instead.
func (*PlacementUpdateRequest) GetBannerID ¶
func (x *PlacementUpdateRequest) GetBannerID() uint64
func (*PlacementUpdateRequest) GetClicks ¶
func (x *PlacementUpdateRequest) GetClicks() int64
func (*PlacementUpdateRequest) GetGroupID ¶
func (x *PlacementUpdateRequest) GetGroupID() uint64
func (*PlacementUpdateRequest) GetID ¶
func (x *PlacementUpdateRequest) GetID() uint64
func (*PlacementUpdateRequest) GetScore ¶
func (x *PlacementUpdateRequest) GetScore() float64
func (*PlacementUpdateRequest) GetShows ¶
func (x *PlacementUpdateRequest) GetShows() int64
func (*PlacementUpdateRequest) GetSlotID ¶
func (x *PlacementUpdateRequest) GetSlotID() uint64
func (*PlacementUpdateRequest) ProtoMessage ¶
func (*PlacementUpdateRequest) ProtoMessage()
func (*PlacementUpdateRequest) ProtoReflect ¶
func (x *PlacementUpdateRequest) ProtoReflect() protoreflect.Message
func (*PlacementUpdateRequest) Reset ¶
func (x *PlacementUpdateRequest) Reset()
func (*PlacementUpdateRequest) String ¶
func (x *PlacementUpdateRequest) String() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(configPtr *config.Configuration, loggerPtr *logger.Logger, storageI interfaces.Storage, queueI interfaces.Queue) *Server
func (Server) BannerClick ¶
func (s Server) BannerClick(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
func (Server) BannerShow ¶
func (s Server) BannerShow(ctx context.Context, r *BannerShowRequest) (*PlacementResponse, error)
func (Server) CreateBanner ¶
func (s Server) CreateBanner(ctx context.Context, r *SimpleCreateRequest) (*SimpleResponse, error)
func (Server) CreateGroup ¶
func (s Server) CreateGroup(ctx context.Context, r *SimpleCreateRequest) (*SimpleResponse, error)
func (Server) CreatePlacement ¶
func (s Server) CreatePlacement(ctx context.Context, r *PlacementCreateRequest) (*PlacementIDsResponse, error)
func (Server) CreateSlot ¶
func (s Server) CreateSlot(ctx context.Context, r *SimpleCreateRequest) (*SimpleResponse, error)
func (Server) DeleteBanner ¶
func (s Server) DeleteBanner(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
func (Server) DeleteGroup ¶
func (s Server) DeleteGroup(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
func (Server) DeletePlacement ¶
func (s Server) DeletePlacement(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
func (Server) DeleteSlot ¶
func (s Server) DeleteSlot(ctx context.Context, r *SimpleRequestID) (*SimpleResponseID, error)
func (Server) ReadBanners ¶
func (Server) ReadGroups ¶
func (Server) ReadPlacements ¶
func (Server) UpdateBanner ¶
func (s Server) UpdateBanner(ctx context.Context, r *SimpleUpdateRequest) (*SimpleResponse, error)
func (Server) UpdateGroup ¶
func (s Server) UpdateGroup(ctx context.Context, r *SimpleUpdateRequest) (*SimpleResponse, error)
func (Server) UpdatePlacement ¶
func (s Server) UpdatePlacement(ctx context.Context, r *PlacementUpdateRequest) (*PlacementIDsResponse, error)
func (Server) UpdateSlot ¶
func (s Server) UpdateSlot(ctx context.Context, r *SimpleUpdateRequest) (*SimpleResponse, error)
type SimpleCreateRequest ¶
type SimpleCreateRequest struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` Description string `protobuf:"bytes,2,opt,name=Description,proto3" json:"Description,omitempty"` // contains filtered or unexported fields }
func (*SimpleCreateRequest) Descriptor
deprecated
func (*SimpleCreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use SimpleCreateRequest.ProtoReflect.Descriptor instead.
func (*SimpleCreateRequest) GetDescription ¶
func (x *SimpleCreateRequest) GetDescription() string
func (*SimpleCreateRequest) GetName ¶
func (x *SimpleCreateRequest) GetName() string
func (*SimpleCreateRequest) ProtoMessage ¶
func (*SimpleCreateRequest) ProtoMessage()
func (*SimpleCreateRequest) ProtoReflect ¶
func (x *SimpleCreateRequest) ProtoReflect() protoreflect.Message
func (*SimpleCreateRequest) Reset ¶
func (x *SimpleCreateRequest) Reset()
func (*SimpleCreateRequest) String ¶
func (x *SimpleCreateRequest) String() string
type SimpleRequestID ¶
type SimpleRequestID struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // contains filtered or unexported fields }
func (*SimpleRequestID) Descriptor
deprecated
func (*SimpleRequestID) Descriptor() ([]byte, []int)
Deprecated: Use SimpleRequestID.ProtoReflect.Descriptor instead.
func (*SimpleRequestID) GetID ¶
func (x *SimpleRequestID) GetID() uint64
func (*SimpleRequestID) ProtoMessage ¶
func (*SimpleRequestID) ProtoMessage()
func (*SimpleRequestID) ProtoReflect ¶
func (x *SimpleRequestID) ProtoReflect() protoreflect.Message
func (*SimpleRequestID) Reset ¶
func (x *SimpleRequestID) Reset()
func (*SimpleRequestID) String ¶
func (x *SimpleRequestID) String() string
type SimpleResponse ¶
type SimpleResponse struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` Description string `protobuf:"bytes,3,opt,name=Description,proto3" json:"Description,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` // contains filtered or unexported fields }
func ConvertBannerToSimpleResponse ¶
func ConvertBannerToSimpleResponse(b structs.Banner) *SimpleResponse
func ConvertGroupToSimpleResponse ¶
func ConvertGroupToSimpleResponse(b structs.Group) *SimpleResponse
func ConvertSlotToSimpleResponse ¶
func ConvertSlotToSimpleResponse(b structs.Slot) *SimpleResponse
func (*SimpleResponse) Descriptor
deprecated
func (*SimpleResponse) Descriptor() ([]byte, []int)
Deprecated: Use SimpleResponse.ProtoReflect.Descriptor instead.
func (*SimpleResponse) GetCreatedAt ¶
func (x *SimpleResponse) GetCreatedAt() *timestamp.Timestamp
func (*SimpleResponse) GetDescription ¶
func (x *SimpleResponse) GetDescription() string
func (*SimpleResponse) GetID ¶
func (x *SimpleResponse) GetID() uint64
func (*SimpleResponse) GetName ¶
func (x *SimpleResponse) GetName() string
func (*SimpleResponse) GetUpdatedAt ¶
func (x *SimpleResponse) GetUpdatedAt() *timestamp.Timestamp
func (*SimpleResponse) ProtoMessage ¶
func (*SimpleResponse) ProtoMessage()
func (*SimpleResponse) ProtoReflect ¶
func (x *SimpleResponse) ProtoReflect() protoreflect.Message
func (*SimpleResponse) Reset ¶
func (x *SimpleResponse) Reset()
func (*SimpleResponse) String ¶
func (x *SimpleResponse) String() string
type SimpleResponseID ¶
type SimpleResponseID struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // contains filtered or unexported fields }
func (*SimpleResponseID) Descriptor
deprecated
func (*SimpleResponseID) Descriptor() ([]byte, []int)
Deprecated: Use SimpleResponseID.ProtoReflect.Descriptor instead.
func (*SimpleResponseID) GetID ¶
func (x *SimpleResponseID) GetID() uint64
func (*SimpleResponseID) ProtoMessage ¶
func (*SimpleResponseID) ProtoMessage()
func (*SimpleResponseID) ProtoReflect ¶
func (x *SimpleResponseID) ProtoReflect() protoreflect.Message
func (*SimpleResponseID) Reset ¶
func (x *SimpleResponseID) Reset()
func (*SimpleResponseID) String ¶
func (x *SimpleResponseID) String() string
type SimpleUpdateRequest ¶
type SimpleUpdateRequest struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` Description string `protobuf:"bytes,3,opt,name=Description,proto3" json:"Description,omitempty"` // contains filtered or unexported fields }
func (*SimpleUpdateRequest) Descriptor
deprecated
func (*SimpleUpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use SimpleUpdateRequest.ProtoReflect.Descriptor instead.
func (*SimpleUpdateRequest) GetDescription ¶
func (x *SimpleUpdateRequest) GetDescription() string
func (*SimpleUpdateRequest) GetID ¶
func (x *SimpleUpdateRequest) GetID() uint64
func (*SimpleUpdateRequest) GetName ¶
func (x *SimpleUpdateRequest) GetName() string
func (*SimpleUpdateRequest) ProtoMessage ¶
func (*SimpleUpdateRequest) ProtoMessage()
func (*SimpleUpdateRequest) ProtoReflect ¶
func (x *SimpleUpdateRequest) ProtoReflect() protoreflect.Message
func (*SimpleUpdateRequest) Reset ¶
func (x *SimpleUpdateRequest) Reset()
func (*SimpleUpdateRequest) String ¶
func (x *SimpleUpdateRequest) String() string
type UnimplementedBannerServer ¶
type UnimplementedBannerServer struct { }
UnimplementedBannerServer should be embedded to have forward compatible implementations.
func (UnimplementedBannerServer) BannerClick ¶
func (UnimplementedBannerServer) BannerClick(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
func (UnimplementedBannerServer) BannerShow ¶
func (UnimplementedBannerServer) BannerShow(context.Context, *BannerShowRequest) (*PlacementResponse, error)
func (UnimplementedBannerServer) CreateBanner ¶
func (UnimplementedBannerServer) CreateBanner(context.Context, *SimpleCreateRequest) (*SimpleResponse, error)
func (UnimplementedBannerServer) CreateGroup ¶
func (UnimplementedBannerServer) CreateGroup(context.Context, *SimpleCreateRequest) (*SimpleResponse, error)
func (UnimplementedBannerServer) CreatePlacement ¶
func (UnimplementedBannerServer) CreatePlacement(context.Context, *PlacementCreateRequest) (*PlacementIDsResponse, error)
func (UnimplementedBannerServer) CreateSlot ¶
func (UnimplementedBannerServer) CreateSlot(context.Context, *SimpleCreateRequest) (*SimpleResponse, error)
func (UnimplementedBannerServer) DeleteBanner ¶
func (UnimplementedBannerServer) DeleteBanner(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
func (UnimplementedBannerServer) DeleteGroup ¶
func (UnimplementedBannerServer) DeleteGroup(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
func (UnimplementedBannerServer) DeletePlacement ¶
func (UnimplementedBannerServer) DeletePlacement(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
func (UnimplementedBannerServer) DeleteSlot ¶
func (UnimplementedBannerServer) DeleteSlot(context.Context, *SimpleRequestID) (*SimpleResponseID, error)
func (UnimplementedBannerServer) ReadBanners ¶
func (UnimplementedBannerServer) ReadBanners(context.Context, *empty.Empty) (*MultipleSimpleResponse, error)
func (UnimplementedBannerServer) ReadGroups ¶
func (UnimplementedBannerServer) ReadGroups(context.Context, *empty.Empty) (*MultipleSimpleResponse, error)
func (UnimplementedBannerServer) ReadPlacements ¶
func (UnimplementedBannerServer) ReadPlacements(context.Context, *empty.Empty) (*MultiplePlacementResponse, error)
func (UnimplementedBannerServer) ReadSlots ¶
func (UnimplementedBannerServer) ReadSlots(context.Context, *empty.Empty) (*MultipleSimpleResponse, error)
func (UnimplementedBannerServer) UpdateBanner ¶
func (UnimplementedBannerServer) UpdateBanner(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error)
func (UnimplementedBannerServer) UpdateGroup ¶
func (UnimplementedBannerServer) UpdateGroup(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error)
func (UnimplementedBannerServer) UpdatePlacement ¶
func (UnimplementedBannerServer) UpdatePlacement(context.Context, *PlacementUpdateRequest) (*PlacementIDsResponse, error)
func (UnimplementedBannerServer) UpdateSlot ¶
func (UnimplementedBannerServer) UpdateSlot(context.Context, *SimpleUpdateRequest) (*SimpleResponse, error)
type UnsafeBannerServer ¶
type UnsafeBannerServer interface {
// contains filtered or unexported methods
}
UnsafeBannerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BannerServer will result in compilation errors.