orchestrator

package
v0.0.0-...-742d8af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_orchestrator_api_proto protoreflect.FileDescriptor

Functions

func RegisterOrchestratorServer

func RegisterOrchestratorServer(s *grpc.Server, srv OrchestratorServer)

Types

type ChargerCommand

type ChargerCommand struct {

	// Opaque connector identifier to which the command applies, usually a single
	// port on a charging station.
	Point string `protobuf:"bytes,1,opt,name=point,proto3" json:"point,omitempty"`
	// Recommended upper bound on charging power in watts. Zero requests that
	// charging cease entirely and infinity advises charging without orchestrator
	// limitations. A negative limit recommends returning energy to the charger,
	// referred to as "V2G" (vehicle to grid) or "V2H" (vehicle to home).
	//
	// Limit applies to any session on the charger, including an ongoing session
	// or a new session.
	//
	// This is "recommended", because the server must not depend on compliance;
	// instead, it should observe compliance via the Session stream.
	Limit float64 `protobuf:"fixed64,2,opt,name=limit,proto3" json:"limit,omitempty"` // Watts
	// Disregard this command after a period of time, after which client should
	// return to its default state. Commands have no explicit expiration if
	// lifetime is absent, but clients are not required to persist limits
	// prolongedly.
	Lifetime *duration.Duration `protobuf:"bytes,3,opt,name=lifetime,proto3" json:"lifetime,omitempty"`
	// contains filtered or unexported fields
}

Server sends a stream of Commands to client, each of which replaces any prior command for the same point. So the client applies the limit only from the most recent command.

func (*ChargerCommand) Descriptor deprecated

func (*ChargerCommand) Descriptor() ([]byte, []int)

Deprecated: Use ChargerCommand.ProtoReflect.Descriptor instead.

func (*ChargerCommand) GetLifetime

func (x *ChargerCommand) GetLifetime() *duration.Duration

func (*ChargerCommand) GetLimit

func (x *ChargerCommand) GetLimit() float64

func (*ChargerCommand) GetPoint

func (x *ChargerCommand) GetPoint() string

func (*ChargerCommand) ProtoMessage

func (*ChargerCommand) ProtoMessage()

func (*ChargerCommand) ProtoReflect

func (x *ChargerCommand) ProtoReflect() protoreflect.Message

func (*ChargerCommand) Reset

func (x *ChargerCommand) Reset()

func (*ChargerCommand) String

func (x *ChargerCommand) String() string

type ChargerSession

type ChargerSession struct {

	// Required opaque connector identifier, usually a single port on a charging
	// station, which must not change during a session.
	Point string `protobuf:"bytes,1,opt,name=point,proto3" json:"point,omitempty"`
	// Required opaque vehicle identifier. This must not change during a single
	// charging session. It should also not change between sessions, since the
	// server uses it to predict energy requirements based on previous sessions.
	// Thus VIN, proximity token ID, account number, or a salted hash thereof are
	// all suitable options.
	Vehicle string `protobuf:"bytes,2,opt,name=vehicle,proto3" json:"vehicle,omitempty"`
	// Immediate power flow across the charging point. Positives values indicate
	// power flowing towards the vehicle, and negative values indicate power
	// flowing from the vehicle.
	//
	// Instantaneous readings are acceptable. Averaged readings over a time
	// window are also acceptable, provided the window size is close to the
	// reporting interval. Minutely averages are conventional.
	//
	// Sessions should be ignored if this value is not known--in other words, do
	// not use zero as unknown.
	Watts float64 `protobuf:"fixed64,3,opt,name=watts,proto3" json:"watts,omitempty"`
	// Required instant at which the energy consumption was read, which must not
	// be before the start time, and should not be after the end time.
	Measured *timestamp.Timestamp `protobuf:"bytes,4,opt,name=measured,proto3" json:"measured,omitempty"`
	// Required instant at which the session was established, typically the point
	// of electrical contact of the plug, but potentially the point when power
	// begins to flow. This must not change during a session.
	Start *timestamp.Timestamp `protobuf:"bytes,5,opt,name=start,proto3" json:"start,omitempty"`
	// Optional instant at which the session was terminated, typically the point
	// of electrical separation of the plug, but potentially the point when power
	// ceases to flow. This is absent for ongoing sessions, and
	End *timestamp.Timestamp `protobuf:"bytes,6,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

Client provides a stream of Session messages to the server, which should be in chronological order by measured time. Server estimates the state of charge using the inferred charging rate and patterns from prior sessions at nearby charging points. Server uses this information to prioritize ongoing sessions when curtailment is necessary.

During a charging session, Session messages have a start time but no end time. Once the session terminates, client should send a Session message with start and end times both set. Otherwise server treats a session as terminated when another (later) session begins on the same point.

Minutely session updates are conventional, although server must accept udpates at any frequency.

func (*ChargerSession) Descriptor deprecated

func (*ChargerSession) Descriptor() ([]byte, []int)

Deprecated: Use ChargerSession.ProtoReflect.Descriptor instead.

func (*ChargerSession) GetEnd

func (x *ChargerSession) GetEnd() *timestamp.Timestamp

func (*ChargerSession) GetMeasured

func (x *ChargerSession) GetMeasured() *timestamp.Timestamp

func (*ChargerSession) GetPoint

func (x *ChargerSession) GetPoint() string

func (*ChargerSession) GetStart

func (x *ChargerSession) GetStart() *timestamp.Timestamp

func (*ChargerSession) GetVehicle

func (x *ChargerSession) GetVehicle() string

func (*ChargerSession) GetWatts

func (x *ChargerSession) GetWatts() float64

func (*ChargerSession) ProtoMessage

func (*ChargerSession) ProtoMessage()

func (*ChargerSession) ProtoReflect

func (x *ChargerSession) ProtoReflect() protoreflect.Message

func (*ChargerSession) Reset

func (x *ChargerSession) Reset()

func (*ChargerSession) String

func (x *ChargerSession) String() string

type OrchestratorClient

type OrchestratorClient interface {
	// Provide status updates and receive directives regarding an electrical
	// vehicle charging point. Client is a controller for one or more charging
	// points, and server is an optimizing coordinator. See Session and Command
	// messages below for details of the requests and responses.
	Charger(ctx context.Context, opts ...grpc.CallOption) (Orchestrator_ChargerClient, error)
}

OrchestratorClient is the client API for Orchestrator 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.

type OrchestratorServer

type OrchestratorServer interface {
	// Provide status updates and receive directives regarding an electrical
	// vehicle charging point. Client is a controller for one or more charging
	// points, and server is an optimizing coordinator. See Session and Command
	// messages below for details of the requests and responses.
	Charger(Orchestrator_ChargerServer) error
	// contains filtered or unexported methods
}

OrchestratorServer is the server API for Orchestrator service. All implementations must embed UnimplementedOrchestratorServer for forward compatibility

type Orchestrator_ChargerClient

type Orchestrator_ChargerClient interface {
	Send(*ChargerSession) error
	Recv() (*ChargerCommand, error)
	grpc.ClientStream
}

type Orchestrator_ChargerServer

type Orchestrator_ChargerServer interface {
	Send(*ChargerCommand) error
	Recv() (*ChargerSession, error)
	grpc.ServerStream
}

type UnimplementedOrchestratorServer

type UnimplementedOrchestratorServer struct {
}

UnimplementedOrchestratorServer must be embedded to have forward compatible implementations.

func (*UnimplementedOrchestratorServer) Charger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL