packages

package
v0.0.0-...-4ae6852 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "gram"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "0.0.1"

APIVersion is the version of the API as defined in the design.

View Source
const ServiceName = "packages"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [5]string{"createPackage", "updatePackage", "listPackages", "listVersions", "publish"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeBadRequest

func MakeBadRequest(err error) *goa.ServiceError

MakeBadRequest builds a goa.ServiceError from an error.

func MakeConflict

func MakeConflict(err error) *goa.ServiceError

MakeConflict builds a goa.ServiceError from an error.

func MakeForbidden

func MakeForbidden(err error) *goa.ServiceError

MakeForbidden builds a goa.ServiceError from an error.

func MakeGatewayError

func MakeGatewayError(err error) *goa.ServiceError

MakeGatewayError builds a goa.ServiceError from an error.

func MakeInvalid

func MakeInvalid(err error) *goa.ServiceError

MakeInvalid builds a goa.ServiceError from an error.

func MakeInvariantViolation

func MakeInvariantViolation(err error) *goa.ServiceError

MakeInvariantViolation builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func MakeUnexpected

func MakeUnexpected(err error) *goa.ServiceError

MakeUnexpected builds a goa.ServiceError from an error.

func MakeUnsupportedMedia

func MakeUnsupportedMedia(err error) *goa.ServiceError

MakeUnsupportedMedia builds a goa.ServiceError from an error.

func NewCreatePackageEndpoint

func NewCreatePackageEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint

NewCreatePackageEndpoint returns an endpoint function that calls the method "createPackage" of service "packages".

func NewListPackagesEndpoint

func NewListPackagesEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint

NewListPackagesEndpoint returns an endpoint function that calls the method "listPackages" of service "packages".

func NewListVersionsEndpoint

func NewListVersionsEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint

NewListVersionsEndpoint returns an endpoint function that calls the method "listVersions" of service "packages".

func NewPublishEndpoint

func NewPublishEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint

NewPublishEndpoint returns an endpoint function that calls the method "publish" of service "packages".

func NewUpdatePackageEndpoint

func NewUpdatePackageEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint

NewUpdatePackageEndpoint returns an endpoint function that calls the method "updatePackage" of service "packages".

Types

type Auther

type Auther interface {
	// APIKeyAuth implements the authorization logic for the APIKey security scheme.
	APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	CreatePackageEndpoint goa.Endpoint
	UpdatePackageEndpoint goa.Endpoint
	ListPackagesEndpoint  goa.Endpoint
	ListVersionsEndpoint  goa.Endpoint
	PublishEndpoint       goa.Endpoint
}

Client is the "packages" service client.

func NewClient

func NewClient(createPackage, updatePackage, listPackages, listVersions, publish goa.Endpoint) *Client

NewClient initializes a "packages" service client given the endpoints.

func (*Client) CreatePackage

func (c *Client) CreatePackage(ctx context.Context, p *CreatePackagePayload) (res *CreatePackageResult, err error)

CreatePackage calls the "createPackage" endpoint of the "packages" service. CreatePackage may return the following errors:

  • "unauthorized" (type *goa.ServiceError): unauthorized access
  • "forbidden" (type *goa.ServiceError): permission denied
  • "bad_request" (type *goa.ServiceError): request is invalid
  • "not_found" (type *goa.ServiceError): resource not found
  • "conflict" (type *goa.ServiceError): resource already exists
  • "unsupported_media" (type *goa.ServiceError): unsupported media type
  • "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
  • "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
  • "unexpected" (type *goa.ServiceError): an unexpected error occurred
  • "gateway_error" (type *goa.ServiceError): an unexpected error occurred
  • error: internal error

func (*Client) ListPackages

func (c *Client) ListPackages(ctx context.Context, p *ListPackagesPayload) (res *ListPackagesResult, err error)

ListPackages calls the "listPackages" endpoint of the "packages" service. ListPackages may return the following errors:

  • "unauthorized" (type *goa.ServiceError): unauthorized access
  • "forbidden" (type *goa.ServiceError): permission denied
  • "bad_request" (type *goa.ServiceError): request is invalid
  • "not_found" (type *goa.ServiceError): resource not found
  • "conflict" (type *goa.ServiceError): resource already exists
  • "unsupported_media" (type *goa.ServiceError): unsupported media type
  • "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
  • "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
  • "unexpected" (type *goa.ServiceError): an unexpected error occurred
  • "gateway_error" (type *goa.ServiceError): an unexpected error occurred
  • error: internal error

func (*Client) ListVersions

func (c *Client) ListVersions(ctx context.Context, p *ListVersionsPayload) (res *ListVersionsResult, err error)

ListVersions calls the "listVersions" endpoint of the "packages" service. ListVersions may return the following errors:

  • "unauthorized" (type *goa.ServiceError): unauthorized access
  • "forbidden" (type *goa.ServiceError): permission denied
  • "bad_request" (type *goa.ServiceError): request is invalid
  • "not_found" (type *goa.ServiceError): resource not found
  • "conflict" (type *goa.ServiceError): resource already exists
  • "unsupported_media" (type *goa.ServiceError): unsupported media type
  • "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
  • "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
  • "unexpected" (type *goa.ServiceError): an unexpected error occurred
  • "gateway_error" (type *goa.ServiceError): an unexpected error occurred
  • error: internal error

func (*Client) Publish

func (c *Client) Publish(ctx context.Context, p *PublishPayload) (res *PublishPackageResult, err error)

Publish calls the "publish" endpoint of the "packages" service. Publish may return the following errors:

  • "unauthorized" (type *goa.ServiceError): unauthorized access
  • "forbidden" (type *goa.ServiceError): permission denied
  • "bad_request" (type *goa.ServiceError): request is invalid
  • "not_found" (type *goa.ServiceError): resource not found
  • "conflict" (type *goa.ServiceError): resource already exists
  • "unsupported_media" (type *goa.ServiceError): unsupported media type
  • "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
  • "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
  • "unexpected" (type *goa.ServiceError): an unexpected error occurred
  • "gateway_error" (type *goa.ServiceError): an unexpected error occurred
  • error: internal error

func (*Client) UpdatePackage

func (c *Client) UpdatePackage(ctx context.Context, p *UpdatePackagePayload) (res *UpdatePackageResult, err error)

UpdatePackage calls the "updatePackage" endpoint of the "packages" service. UpdatePackage may return the following errors:

  • "not_modified" (type *NotModified)
  • "unauthorized" (type *goa.ServiceError): unauthorized access
  • "forbidden" (type *goa.ServiceError): permission denied
  • "bad_request" (type *goa.ServiceError): request is invalid
  • "not_found" (type *goa.ServiceError): resource not found
  • "conflict" (type *goa.ServiceError): resource already exists
  • "unsupported_media" (type *goa.ServiceError): unsupported media type
  • "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
  • "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
  • "unexpected" (type *goa.ServiceError): an unexpected error occurred
  • "gateway_error" (type *goa.ServiceError): an unexpected error occurred
  • error: internal error

type CreatePackagePayload

type CreatePackagePayload struct {
	ApikeyToken      *string
	SessionToken     *string
	ProjectSlugInput *string
	// The name of the package
	Name string
	// The title of the package
	Title string
	// The summary of the package
	Summary string
	// The description of the package. Limited markdown syntax is supported.
	Description *string
	// External URL for the package owner
	URL *string
	// The keywords of the package
	Keywords []string
	// The asset ID of the image to show for this package
	ImageAssetID *string
}

CreatePackagePayload is the payload type of the packages service createPackage method.

type CreatePackageResult

type CreatePackageResult struct {
	// The newly created package
	Package *Package
}

CreatePackageResult is the result type of the packages service createPackage method.

type Endpoints

type Endpoints struct {
	CreatePackage goa.Endpoint
	UpdatePackage goa.Endpoint
	ListPackages  goa.Endpoint
	ListVersions  goa.Endpoint
	Publish       goa.Endpoint
}

Endpoints wraps the "packages" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "packages" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "packages" service endpoints.

type ListPackagesPayload

type ListPackagesPayload struct {
	ApikeyToken      *string
	SessionToken     *string
	ProjectSlugInput *string
}

ListPackagesPayload is the payload type of the packages service listPackages method.

type ListPackagesResult

type ListPackagesResult struct {
	// The list of packages
	Packages []*Package
}

ListPackagesResult is the result type of the packages service listPackages method.

type ListVersionsPayload

type ListVersionsPayload struct {
	ApikeyToken      *string
	SessionToken     *string
	ProjectSlugInput *string
	// The name of the package
	Name string
}

ListVersionsPayload is the payload type of the packages service listVersions method.

type ListVersionsResult

type ListVersionsResult struct {
	Package  *Package
	Versions []*PackageVersion
}

ListVersionsResult is the result type of the packages service listVersions method.

type NotModified

type NotModified struct {
	Location string
}

func (*NotModified) Error

func (e *NotModified) Error() string

Error returns an error description.

func (*NotModified) ErrorName deprecated

func (e *NotModified) ErrorName() string

ErrorName returns "not_modified".

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (*NotModified) GoaErrorName

func (e *NotModified) GoaErrorName() string

GoaErrorName returns "not_modified".

type Package

type Package struct {
	// The ID of the package
	ID string
	// The ID of the project that owns the package
	ProjectID string
	// The ID of the organization that owns the package
	OrganizationID string
	// The name of the package
	Name string
	// The title of the package
	Title *string
	// The summary of the package
	Summary *string
	// The description of the package. This contains HTML content.
	Description *string
	// The unsanitized, user-supplied description of the package. Limited markdown
	// syntax is supported.
	DescriptionRaw *string
	// The keywords of the package
	Keywords []string
	// External URL for the package owner
	URL *string
	// The asset ID of the image to show for this package
	ImageAssetID *string
	// The latest version of the package
	LatestVersion *string
	// The creation date of the package
	CreatedAt string
	// The last update date of the package
	UpdatedAt string
	// The deletion date of the package
	DeletedAt *string
}

type PackageVersion

type PackageVersion struct {
	// The ID of the package version
	ID string
	// The ID of the package that the version belongs to
	PackageID string
	// The ID of the deployment that the version belongs to
	DeploymentID string
	// The visibility of the package version
	Visibility string
	// The semantic version value
	Semver string
	// The creation date of the package version
	CreatedAt string
}

type PublishPackageResult

type PublishPackageResult struct {
	// The published package
	Package *Package
	// The published package version
	Version *PackageVersion
}

PublishPackageResult is the result type of the packages service publish method.

type PublishPayload

type PublishPayload struct {
	ApikeyToken      *string
	SessionToken     *string
	ProjectSlugInput *string
	// The name of the package
	Name string
	// The new semantic version of the package to publish
	Version string
	// The deployment ID to associate with the package version
	DeploymentID string
	// The visibility of the package version
	Visibility string
}

PublishPayload is the payload type of the packages service publish method.

type Service

type Service interface {
	// Create a new package for a project.
	CreatePackage(context.Context, *CreatePackagePayload) (res *CreatePackageResult, err error)
	// Update package details.
	UpdatePackage(context.Context, *UpdatePackagePayload) (res *UpdatePackageResult, err error)
	// List all packages for a project.
	ListPackages(context.Context, *ListPackagesPayload) (res *ListPackagesResult, err error)
	// List published versions of a package.
	ListVersions(context.Context, *ListVersionsPayload) (res *ListVersionsResult, err error)
	// Publish a new version of a package.
	Publish(context.Context, *PublishPayload) (res *PublishPackageResult, err error)
}

Manages packages in Gram.

type UpdatePackagePayload

type UpdatePackagePayload struct {
	ApikeyToken      *string
	SessionToken     *string
	ProjectSlugInput *string
	// The id of the package to update
	ID string
	// The title of the package
	Title *string
	// The summary of the package
	Summary *string
	// The description of the package. Limited markdown syntax is supported.
	Description *string
	// External URL for the package owner
	URL *string
	// The keywords of the package
	Keywords []string
	// The asset ID of the image to show for this package
	ImageAssetID *string
}

UpdatePackagePayload is the payload type of the packages service updatePackage method.

type UpdatePackageResult

type UpdatePackageResult struct {
	// The newly created package
	Package *Package
}

UpdatePackageResult is the result type of the packages service updatePackage method.

Jump to

Keyboard shortcuts

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