astro

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Astro_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "astro.Astro",
	HandlerType: (*AstroServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Sunrise",
			Handler:    _Astro_Sunrise_Handler,
		},
		{
			MethodName: "Sunset",
			Handler:    _Astro_Sunset_Handler,
		},
		{
			MethodName: "PreSunset",
			Handler:    _Astro_PreSunset_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "internal/astro/astro.proto",
}

Astro_ServiceDesc is the grpc.ServiceDesc for Astro service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_internal_astro_astro_proto protoreflect.FileDescriptor

Functions

func RegisterAstroServer

func RegisterAstroServer(s grpc.ServiceRegistrar, srv AstroServer)

Types

type Astro

type Astro struct {
	UnimplementedAstroServer
	services.Service
	// contains filtered or unexported fields
}

func New

func New(cfg Config, logger log.Logger, conn *grpc.ClientConn) (*Astro, error)

func (*Astro) Connect

func (a *Astro) Connect(ctx context.Context) error

Connect implements events.Producer

func (*Astro) PreSunset

func (a *Astro) PreSunset(ctx context.Context, req *Empty) (*Empty, error)

PreSunset implements AstroServer.

func (*Astro) Sunrise

func (a *Astro) Sunrise(ctx context.Context, req *Empty) (*Empty, error)

Sunrise implements AstroServer.

func (*Astro) Sunset

func (a *Astro) Sunset(ctx context.Context, req *Empty) (*Empty, error)

Sunset implements AstroServer.

type AstroClient

type AstroClient interface {
	Sunrise(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	Sunset(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	PreSunset(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
}

AstroClient is the client API for Astro 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 NewAstroClient

func NewAstroClient(cc grpc.ClientConnInterface) AstroClient

type AstroServer

type AstroServer interface {
	Sunrise(context.Context, *Empty) (*Empty, error)
	Sunset(context.Context, *Empty) (*Empty, error)
	PreSunset(context.Context, *Empty) (*Empty, error)
	// contains filtered or unexported methods
}

AstroServer is the server API for Astro service. All implementations must embed UnimplementedAstroServer for forward compatibility

type Config

type Config struct {
	MetricsURL string   `yaml:"metrics_url"`
	Locations  []string `yaml:"locations"`
}

Config is where the information necessary to query Prometheus for the given metrics that we will keep an eye on.

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type UnimplementedAstroServer

type UnimplementedAstroServer struct {
}

UnimplementedAstroServer must be embedded to have forward compatible implementations.

func (UnimplementedAstroServer) PreSunset

func (UnimplementedAstroServer) Sunrise

func (UnimplementedAstroServer) Sunset

type UnsafeAstroServer

type UnsafeAstroServer interface {
	// contains filtered or unexported methods
}

UnsafeAstroServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AstroServer will result in compilation errors.

Jump to

Keyboard shortcuts

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