Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertUint64ToInt64(uint64Value uint64) int64
- func GetDistinctValues(resp []string) []string
- func GetReleaseSchema(table string) *dynamodb.CreateTableInput
- func NewBrowseGrpcClient(endpoint string) releaseSvc.BrowseClient
- func NewPublisherGrpcClient(endpoint string) releaseSvc.PublisherClient
- func NotifyWebhook(payload Release) error
- type Release
- type ReleaseService
- func (s *ReleaseService) GetLatestRelease(ctx context.Context, request *releaseSvc.ListReleasesRequest) (*releaseSvc.ListReleasesResponse, error)
- func (s *ReleaseService) ListOrganization(ctx context.Context, request *releaseSvc.ListOrganizationRequest) (*releaseSvc.ListOrganizationResponse, error)
- func (s *ReleaseService) ListReleaseTypes(ctx context.Context, request *releaseSvc.ListReleaseTypesRequest) (*releaseSvc.ListReleaseTypesResponse, error)
- func (s *ReleaseService) ListReleases(ctx context.Context, request *releaseSvc.ListReleasesRequest) (*releaseSvc.ListReleasesResponse, error)
- func (s *ReleaseService) Publish(ctx context.Context, request *release.PublishRequest) (*release.PublishResponse, error)
- func (s *ReleaseService) RegisterWithServer(grpcServer grpc.ServiceRegistrar) error
Constants ¶
View Source
const ( DefaultReleaseTableName = "terrarium-releases" DefaultReleaseServiceEndpoint = "release:3001" )
Variables ¶
View Source
var ( ReleaseTableName = DefaultReleaseTableName ReleaseTableInitializationError = status.Error(codes.Unknown, "Failed to initialize table for releases.") ReleaseServiceEndpoint = DefaultReleaseServiceEndpoint ReleasePublished = &release.PublishResponse{} MarshalReleaseError = status.Error(codes.Unknown, "Failed to marshal publish release.") PublishReleaseError = status.Error(codes.Unknown, "Failed to publish release.") ReleaseNotFound = status.Error(codes.NotFound, "Release not found.") TimeFormatLayout = "2006-01-02 15:04:05.999999999 -0700 MST" DefaultMaxAgeSeconds = uint64(86400) // 1 day in seconds )
Functions ¶
func ConvertUint64ToInt64 ¶ added in v0.0.64
Converts Uint64 to int64
func GetDistinctValues ¶ added in v0.0.64
GetDistinctValues is a helper function to filter the response and return only distinct values.
func GetReleaseSchema ¶ added in v0.0.60
func GetReleaseSchema(table string) *dynamodb.CreateTableInput
GetReleaseSchema returns CreateTableInput that can be used to create table if it does not exist
func NewBrowseGrpcClient ¶ added in v0.0.67
func NewBrowseGrpcClient(endpoint string) releaseSvc.BrowseClient
func NewPublisherGrpcClient ¶ added in v0.0.67
func NewPublisherGrpcClient(endpoint string) releaseSvc.PublisherClient
func NotifyWebhook ¶ added in v0.0.62
Function to send notifications to webhook
Types ¶
type Release ¶ added in v0.0.61
type Release struct { Type string `json:"type" bson:"type" dynamodbav:"type"` Organization string `json:"organization" bson:"organization" dynamodbav:"organization"` Name string `json:"name" bson:"name" dynamodbav:"name"` Version string `json:"version" bson:"version" dynamodbav:"version"` Description string `json:"description" bson:"description" dynamodbav:"description"` Links []*release.Link `json:"links" bson:"links" dynamodbav:"links"` CreatedAt string `json:"createdAt" bson:"createdAt" dynamodbav:"createdAt"` }
type ReleaseService ¶
type ReleaseService struct { releaseSvc.UnimplementedPublisherServer releaseSvc.UnimplementedBrowseServer Db storage.DynamoDBTableCreator Table string Schema *dynamodb.CreateTableInput }
func (*ReleaseService) GetLatestRelease ¶ added in v0.0.61
func (s *ReleaseService) GetLatestRelease(ctx context.Context, request *releaseSvc.ListReleasesRequest) (*releaseSvc.ListReleasesResponse, error)
GetLatestRelease retrieves the latest release.
func (*ReleaseService) ListOrganization ¶ added in v0.0.64
func (s *ReleaseService) ListOrganization(ctx context.Context, request *releaseSvc.ListOrganizationRequest) (*releaseSvc.ListOrganizationResponse, error)
ListOrganization is used to retrieve all distinct organizations.
func (*ReleaseService) ListReleaseTypes ¶ added in v0.0.64
func (s *ReleaseService) ListReleaseTypes(ctx context.Context, request *releaseSvc.ListReleaseTypesRequest) (*releaseSvc.ListReleaseTypesResponse, error)
ListReleaseTypes is used to retrieve all distinct release types.
func (*ReleaseService) ListReleases ¶ added in v0.0.61
func (s *ReleaseService) ListReleases(ctx context.Context, request *releaseSvc.ListReleasesRequest) (*releaseSvc.ListReleasesResponse, error)
ListReleases retrieves all releases. Only releases that have been published should be reported.
func (*ReleaseService) Publish ¶ added in v0.0.61
func (s *ReleaseService) Publish(ctx context.Context, request *release.PublishRequest) (*release.PublishResponse, error)
Publish is used to publish a new release.
func (*ReleaseService) RegisterWithServer ¶
func (s *ReleaseService) RegisterWithServer(grpcServer grpc.ServiceRegistrar) error
RegisterWithServer registers ReleaseService with grpc server
Click to show internal directories.
Click to hide internal directories.