v1

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package v1 contains the v1 GRPC client and server definitions for implementing notifications interactions for the Platform.

Index

Constants

View Source
const (
	Notifications_List_FullMethodName = "/chainguard.platform.notifications.Notifications/List"
)

Variables

View Source
var (
	NotificationsFilter_Location_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "CONSOLE",
		2: "DIRECTORY",
		3: "CHAINCTL",
	}
	NotificationsFilter_Location_value = map[string]int32{
		"UNSPECIFIED": 0,
		"CONSOLE":     1,
		"DIRECTORY":   2,
		"CHAINCTL":    3,
	}
)

Enum value maps for NotificationsFilter_Location.

View Source
var File_notifications_platform_proto protoreflect.FileDescriptor
View Source
var Notifications_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "chainguard.platform.notifications.Notifications",
	HandlerType: (*NotificationsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _Notifications_List_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "notifications.platform.proto",
}

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

Functions

func RegisterNotificationsHandler

func RegisterNotificationsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterNotificationsHandler registers the http handlers for service Notifications to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterNotificationsHandlerClient

func RegisterNotificationsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotificationsClient) error

RegisterNotificationsHandlerClient registers the http handlers for service Notifications to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NotificationsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NotificationsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NotificationsClient" to call the correct interceptors. This client ignores the HTTP middlewares.

func RegisterNotificationsHandlerFromEndpoint

func RegisterNotificationsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterNotificationsHandlerFromEndpoint is same as RegisterNotificationsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterNotificationsHandlerServer

func RegisterNotificationsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotificationsServer) error

RegisterNotificationsHandlerServer registers the http handlers for service Notifications to "mux". UnaryRPC :call NotificationsServer 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 RegisterNotificationsHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterNotificationsServer

func RegisterNotificationsServer(s grpc.ServiceRegistrar, srv NotificationsServer)

Types

type Account

type Account struct {

	// id of the account.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// when the account was created.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// when the account was last updated.
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// name of the account.
	Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Account) Descriptor deprecated

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetCreatedAt

func (x *Account) GetCreatedAt() *timestamppb.Timestamp

func (*Account) GetId

func (x *Account) GetId() string

func (*Account) GetName

func (x *Account) GetName() string

func (*Account) GetUpdatedAt

func (x *Account) GetUpdatedAt() *timestamppb.Timestamp

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

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

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

type Author

type Author struct {

	// id of the author.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// name of the author.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// email of the author.
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*Author) Descriptor deprecated

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

Deprecated: Use Author.ProtoReflect.Descriptor instead.

func (*Author) GetEmail

func (x *Author) GetEmail() string

func (*Author) GetId

func (x *Author) GetId() string

func (*Author) GetName

func (x *Author) GetName() string

func (*Author) ProtoMessage

func (*Author) ProtoMessage()

func (*Author) ProtoReflect

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

func (*Author) Reset

func (x *Author) Reset()

func (*Author) String

func (x *Author) String() string

type Clients

type Clients interface {
	Notifications() NotificationsClient

	Close() error
}

func NewClients

func NewClients(ctx context.Context, addr string, token string) (Clients, error)

func NewClientsFromConnection

func NewClientsFromConnection(conn *grpc.ClientConn) Clients

type Notification

type Notification struct {

	// id is the identifier of this specific notification.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// when the notification was created.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// when the notification was last updated.
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// id of the category the notification belongs to.
	CategoryId string `protobuf:"bytes,4,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"`
	// subject or title of the notification.
	Subject string `protobuf:"bytes,5,opt,name=subject,proto3" json:"subject,omitempty"`
	// the body of the notification.
	Note string `protobuf:"bytes,6,opt,name=note,proto3" json:"note,omitempty"`
	// date when the notification was created.
	NoteDate *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=note_date,json=noteDate,proto3" json:"note_date,omitempty"`
	// tags associated with the notification.
	Tags []string `protobuf:"bytes,8,rep,name=tags,proto3" json:"tags,omitempty"`
	// account associated with the notification.
	Account *Account `protobuf:"bytes,9,opt,name=account,proto3" json:"account,omitempty"`
	// author associated with the notification.
	Author *Author `protobuf:"bytes,10,opt,name=author,proto3" json:"author,omitempty"`
	// account id associated with the notification.
	AccountId string `protobuf:"bytes,11,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`
	// author id associated with the notification.
	AuthorId string `protobuf:"bytes,12,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
	// traits associated with the notification.
	Traits *Traits `protobuf:"bytes,13,opt,name=traits,proto3" json:"traits,omitempty"`
	// contains filtered or unexported fields
}

func (*Notification) Descriptor deprecated

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

Deprecated: Use Notification.ProtoReflect.Descriptor instead.

func (*Notification) GetAccount

func (x *Notification) GetAccount() *Account

func (*Notification) GetAccountId

func (x *Notification) GetAccountId() string

func (*Notification) GetAuthor

func (x *Notification) GetAuthor() *Author

func (*Notification) GetAuthorId

func (x *Notification) GetAuthorId() string

func (*Notification) GetCategoryId

func (x *Notification) GetCategoryId() string

func (*Notification) GetCreatedAt

func (x *Notification) GetCreatedAt() *timestamppb.Timestamp

func (*Notification) GetId

func (x *Notification) GetId() string

func (*Notification) GetNote

func (x *Notification) GetNote() string

func (*Notification) GetNoteDate

func (x *Notification) GetNoteDate() *timestamppb.Timestamp

func (*Notification) GetSubject

func (x *Notification) GetSubject() string

func (*Notification) GetTags

func (x *Notification) GetTags() []string

func (*Notification) GetTraits

func (x *Notification) GetTraits() *Traits

func (*Notification) GetUpdatedAt

func (x *Notification) GetUpdatedAt() *timestamppb.Timestamp

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) ProtoReflect

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

func (*Notification) Reset

func (x *Notification) Reset()

func (*Notification) String

func (x *Notification) String() string

type NotificationsClient

type NotificationsClient interface {
	List(ctx context.Context, in *NotificationsFilter, opts ...grpc.CallOption) (*NotificationsList, error)
}

NotificationsClient is the client API for Notifications 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 NotificationsFilter

type NotificationsFilter struct {

	// The id of the notification.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Location of where notifications are displayed.
	Location NotificationsFilter_Location `` /* 138-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*NotificationsFilter) Descriptor deprecated

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

Deprecated: Use NotificationsFilter.ProtoReflect.Descriptor instead.

func (*NotificationsFilter) GetId

func (x *NotificationsFilter) GetId() string

func (*NotificationsFilter) GetLocation

func (*NotificationsFilter) ProtoMessage

func (*NotificationsFilter) ProtoMessage()

func (*NotificationsFilter) ProtoReflect

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

func (*NotificationsFilter) Reset

func (x *NotificationsFilter) Reset()

func (*NotificationsFilter) String

func (x *NotificationsFilter) String() string

type NotificationsFilter_Location

type NotificationsFilter_Location int32
const (
	// The "unset" value.
	NotificationsFilter_UNSPECIFIED NotificationsFilter_Location = 0
	// Console.
	NotificationsFilter_CONSOLE NotificationsFilter_Location = 1
	// Directory.
	NotificationsFilter_DIRECTORY NotificationsFilter_Location = 2
	// Chainctl.
	NotificationsFilter_CHAINCTL NotificationsFilter_Location = 3
)

func (NotificationsFilter_Location) Descriptor

func (NotificationsFilter_Location) Enum

func (NotificationsFilter_Location) EnumDescriptor deprecated

func (NotificationsFilter_Location) EnumDescriptor() ([]byte, []int)

Deprecated: Use NotificationsFilter_Location.Descriptor instead.

func (NotificationsFilter_Location) Number

func (NotificationsFilter_Location) String

func (NotificationsFilter_Location) Type

type NotificationsList

type NotificationsList struct {
	Items []*Notification `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*NotificationsList) Descriptor deprecated

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

Deprecated: Use NotificationsList.ProtoReflect.Descriptor instead.

func (*NotificationsList) GetItems

func (x *NotificationsList) GetItems() []*Notification

func (*NotificationsList) ProtoMessage

func (*NotificationsList) ProtoMessage()

func (*NotificationsList) ProtoReflect

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

func (*NotificationsList) Reset

func (x *NotificationsList) Reset()

func (*NotificationsList) String

func (x *NotificationsList) String() string

type NotificationsServer

type NotificationsServer interface {
	List(context.Context, *NotificationsFilter) (*NotificationsList, error)
	// contains filtered or unexported methods
}

NotificationsServer is the server API for Notifications service. All implementations must embed UnimplementedNotificationsServer for forward compatibility.

type Traits

type Traits struct {

	// expiration date of the notification.
	Expires *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=expires,proto3" json:"expires,omitempty"`
	// show notification in console.
	Console bool `protobuf:"varint,2,opt,name=console,proto3" json:"console,omitempty"`
	// show notification in directory.
	Directory bool `protobuf:"varint,3,opt,name=directory,proto3" json:"directory,omitempty"`
	// start date of the notification.
	Starts *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=starts,proto3" json:"starts,omitempty"`
	// whether or not notification has been approved.
	Approved bool `protobuf:"varint,5,opt,name=approved,proto3" json:"approved,omitempty"`
	// show notification for chainctl users.
	Chainctl bool `protobuf:"varint,6,opt,name=chainctl,proto3" json:"chainctl,omitempty"`
	// contains filtered or unexported fields
}

func (*Traits) Descriptor deprecated

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

Deprecated: Use Traits.ProtoReflect.Descriptor instead.

func (*Traits) GetApproved

func (x *Traits) GetApproved() bool

func (*Traits) GetChainctl

func (x *Traits) GetChainctl() bool

func (*Traits) GetConsole

func (x *Traits) GetConsole() bool

func (*Traits) GetDirectory

func (x *Traits) GetDirectory() bool

func (*Traits) GetExpires

func (x *Traits) GetExpires() *timestamppb.Timestamp

func (*Traits) GetStarts

func (x *Traits) GetStarts() *timestamppb.Timestamp

func (*Traits) ProtoMessage

func (*Traits) ProtoMessage()

func (*Traits) ProtoReflect

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

func (*Traits) Reset

func (x *Traits) Reset()

func (*Traits) String

func (x *Traits) String() string

type UnimplementedNotificationsServer

type UnimplementedNotificationsServer struct{}

UnimplementedNotificationsServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedNotificationsServer) List

type UnsafeNotificationsServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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