Documentation ¶
Index ¶
- Variables
- func NewCarbonEndpoints() []*api.Endpoint
- func RegisterCarbonHandler(s server.Server, hdlr CarbonHandler, opts ...server.HandlerOption) error
- type CarbonHandler
- type CarbonService
- type OffsetRequest
- type OffsetResponse
- func (*OffsetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *OffsetResponse) GetMetric() string
- func (x *OffsetResponse) GetProjects() []*Project
- func (x *OffsetResponse) GetTonnes() float64
- func (x *OffsetResponse) GetUnits() int32
- func (*OffsetResponse) ProtoMessage()
- func (x *OffsetResponse) ProtoReflect() protoreflect.Message
- func (x *OffsetResponse) Reset()
- func (x *OffsetResponse) String() string
- type Project
- func (*Project) Descriptor() ([]byte, []int)deprecated
- func (x *Project) GetName() string
- func (x *Project) GetPercentage() float64
- func (x *Project) GetTonnes() float64
- func (*Project) ProtoMessage()
- func (x *Project) ProtoReflect() protoreflect.Message
- func (x *Project) Reset()
- func (x *Project) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var File_proto_carbon_proto protoreflect.FileDescriptor
Functions ¶
func NewCarbonEndpoints ¶
func RegisterCarbonHandler ¶
func RegisterCarbonHandler(s server.Server, hdlr CarbonHandler, opts ...server.HandlerOption) error
Types ¶
type CarbonHandler ¶
type CarbonHandler interface {
Offset(context.Context, *OffsetRequest, *OffsetResponse) error
}
type CarbonService ¶
type CarbonService interface {
Offset(ctx context.Context, in *OffsetRequest, opts ...client.CallOption) (*OffsetResponse, error)
}
func NewCarbonService ¶
func NewCarbonService(name string, c client.Client) CarbonService
type OffsetRequest ¶
type OffsetRequest struct {
// contains filtered or unexported fields
}
Purchase 1kg (0.001 tonnes) of carbon offsets in a single request
func (*OffsetRequest) Descriptor
deprecated
func (*OffsetRequest) Descriptor() ([]byte, []int)
Deprecated: Use OffsetRequest.ProtoReflect.Descriptor instead.
func (*OffsetRequest) ProtoMessage ¶
func (*OffsetRequest) ProtoMessage()
func (*OffsetRequest) ProtoReflect ¶
func (x *OffsetRequest) ProtoReflect() protoreflect.Message
func (*OffsetRequest) Reset ¶
func (x *OffsetRequest) Reset()
func (*OffsetRequest) String ¶
func (x *OffsetRequest) String() string
type OffsetResponse ¶
type OffsetResponse struct { // number of units purchased Units int32 `protobuf:"varint,1,opt,name=units,proto3" json:"units,omitempty"` // the metric used e.g KG or Tonnes Metric string `protobuf:"bytes,2,opt,name=metric,proto3" json:"metric,omitempty"` // number of tonnes Tonnes float64 `protobuf:"fixed64,3,opt,name=tonnes,proto3" json:"tonnes,omitempty"` // projects it was allocated to Projects []*Project `protobuf:"bytes,4,rep,name=projects,proto3" json:"projects,omitempty"` // contains filtered or unexported fields }
func (*OffsetResponse) Descriptor
deprecated
func (*OffsetResponse) Descriptor() ([]byte, []int)
Deprecated: Use OffsetResponse.ProtoReflect.Descriptor instead.
func (*OffsetResponse) GetMetric ¶
func (x *OffsetResponse) GetMetric() string
func (*OffsetResponse) GetProjects ¶
func (x *OffsetResponse) GetProjects() []*Project
func (*OffsetResponse) GetTonnes ¶
func (x *OffsetResponse) GetTonnes() float64
func (*OffsetResponse) GetUnits ¶
func (x *OffsetResponse) GetUnits() int32
func (*OffsetResponse) ProtoMessage ¶
func (*OffsetResponse) ProtoMessage()
func (*OffsetResponse) ProtoReflect ¶
func (x *OffsetResponse) ProtoReflect() protoreflect.Message
func (*OffsetResponse) Reset ¶
func (x *OffsetResponse) Reset()
func (*OffsetResponse) String ¶
func (x *OffsetResponse) String() string
type Project ¶
type Project struct { // name of the project Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // percentage that went to this Percentage float64 `protobuf:"fixed64,2,opt,name=percentage,proto3" json:"percentage,omitempty"` // amount in tonnes Tonnes float64 `protobuf:"fixed64,3,opt,name=tonnes,proto3" json:"tonnes,omitempty"` // contains filtered or unexported fields }
func (*Project) Descriptor
deprecated
func (*Project) GetPercentage ¶
func (*Project) ProtoMessage ¶
func (*Project) ProtoMessage()
func (*Project) ProtoReflect ¶
func (x *Project) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.