Documentation ¶
Overview ¶
Example usage
To get started with this package, create a client.
ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client.
ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &emptypb.Empty{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/protobuf/types/known/emptypb#Empty. } resp, err := c.GetStatus(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.
Index ¶
- func DefaultAuthScopes() []string
- type ApiIterator
- type ApiSpecIterator
- type ApiVersionIterator
- type ArtifactIterator
- type ProjectIterator
- type RegistryCallOptions
- type RegistryClient
- func (c *RegistryClient) Close() error
- func (c *RegistryClient) Connection() *grpc.ClientConn
- func (c *RegistryClient) CreateApi(ctx context.Context, req *rpcpb.CreateApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
- func (c *RegistryClient) CreateApiSpec(ctx context.Context, req *rpcpb.CreateApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) CreateApiVersion(ctx context.Context, req *rpcpb.CreateApiVersionRequest, ...) (*rpcpb.ApiVersion, error)
- func (c *RegistryClient) CreateArtifact(ctx context.Context, req *rpcpb.CreateArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
- func (c *RegistryClient) CreateProject(ctx context.Context, req *rpcpb.CreateProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
- func (c *RegistryClient) DeleteApi(ctx context.Context, req *rpcpb.DeleteApiRequest, opts ...gax.CallOption) error
- func (c *RegistryClient) DeleteApiSpec(ctx context.Context, req *rpcpb.DeleteApiSpecRequest, opts ...gax.CallOption) error
- func (c *RegistryClient) DeleteApiSpecRevision(ctx context.Context, req *rpcpb.DeleteApiSpecRevisionRequest, ...) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) DeleteApiVersion(ctx context.Context, req *rpcpb.DeleteApiVersionRequest, ...) error
- func (c *RegistryClient) DeleteArtifact(ctx context.Context, req *rpcpb.DeleteArtifactRequest, opts ...gax.CallOption) error
- func (c *RegistryClient) DeleteProject(ctx context.Context, req *rpcpb.DeleteProjectRequest, opts ...gax.CallOption) error
- func (c *RegistryClient) GetApi(ctx context.Context, req *rpcpb.GetApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
- func (c *RegistryClient) GetApiSpec(ctx context.Context, req *rpcpb.GetApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) GetApiSpecContents(ctx context.Context, req *rpcpb.GetApiSpecContentsRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *RegistryClient) GetApiVersion(ctx context.Context, req *rpcpb.GetApiVersionRequest, opts ...gax.CallOption) (*rpcpb.ApiVersion, error)
- func (c *RegistryClient) GetArtifact(ctx context.Context, req *rpcpb.GetArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
- func (c *RegistryClient) GetArtifactContents(ctx context.Context, req *rpcpb.GetArtifactContentsRequest, ...) (*httpbodypb.HttpBody, error)
- func (c *RegistryClient) GetProject(ctx context.Context, req *rpcpb.GetProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
- func (c *RegistryClient) GetStatus(ctx context.Context, req *emptypb.Empty, opts ...gax.CallOption) (*rpcpb.Status, error)
- func (c *RegistryClient) GrpcClient() rpcpb.RegistryClient
- func (c *RegistryClient) ListApiSpecRevisions(ctx context.Context, req *rpcpb.ListApiSpecRevisionsRequest, ...) *ApiSpecIterator
- func (c *RegistryClient) ListApiSpecs(ctx context.Context, req *rpcpb.ListApiSpecsRequest, opts ...gax.CallOption) *ApiSpecIterator
- func (c *RegistryClient) ListApiVersions(ctx context.Context, req *rpcpb.ListApiVersionsRequest, opts ...gax.CallOption) *ApiVersionIterator
- func (c *RegistryClient) ListApis(ctx context.Context, req *rpcpb.ListApisRequest, opts ...gax.CallOption) *ApiIterator
- func (c *RegistryClient) ListArtifacts(ctx context.Context, req *rpcpb.ListArtifactsRequest, opts ...gax.CallOption) *ArtifactIterator
- func (c *RegistryClient) ListProjects(ctx context.Context, req *rpcpb.ListProjectsRequest, opts ...gax.CallOption) *ProjectIterator
- func (c *RegistryClient) ReplaceArtifact(ctx context.Context, req *rpcpb.ReplaceArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
- func (c *RegistryClient) RollbackApiSpec(ctx context.Context, req *rpcpb.RollbackApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) TagApiSpecRevision(ctx context.Context, req *rpcpb.TagApiSpecRevisionRequest, ...) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) UpdateApi(ctx context.Context, req *rpcpb.UpdateApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
- func (c *RegistryClient) UpdateApiSpec(ctx context.Context, req *rpcpb.UpdateApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
- func (c *RegistryClient) UpdateApiVersion(ctx context.Context, req *rpcpb.UpdateApiVersionRequest, ...) (*rpcpb.ApiVersion, error)
- func (c *RegistryClient) UpdateProject(ctx context.Context, req *rpcpb.UpdateProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
Examples ¶
- NewRegistryClient
- RegistryClient.CreateApi
- RegistryClient.CreateApiSpec
- RegistryClient.CreateApiVersion
- RegistryClient.CreateArtifact
- RegistryClient.CreateProject
- RegistryClient.DeleteApi
- RegistryClient.DeleteApiSpec
- RegistryClient.DeleteApiSpecRevision
- RegistryClient.DeleteApiVersion
- RegistryClient.DeleteArtifact
- RegistryClient.DeleteProject
- RegistryClient.GetApi
- RegistryClient.GetApiSpec
- RegistryClient.GetApiSpecContents
- RegistryClient.GetApiVersion
- RegistryClient.GetArtifact
- RegistryClient.GetArtifactContents
- RegistryClient.GetProject
- RegistryClient.GetStatus
- RegistryClient.ListApiSpecRevisions
- RegistryClient.ListApiSpecs
- RegistryClient.ListApiVersions
- RegistryClient.ListApis
- RegistryClient.ListArtifacts
- RegistryClient.ListProjects
- RegistryClient.ReplaceArtifact
- RegistryClient.RollbackApiSpec
- RegistryClient.TagApiSpecRevision
- RegistryClient.UpdateApi
- RegistryClient.UpdateApiSpec
- RegistryClient.UpdateApiVersion
- RegistryClient.UpdateProject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type ApiIterator ¶
type ApiIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.Api, nextPageToken string, err error) // contains filtered or unexported fields }
ApiIterator manages a stream of *rpcpb.Api.
func (*ApiIterator) Next ¶
func (it *ApiIterator) Next() (*rpcpb.Api, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ApiIterator) PageInfo ¶
func (it *ApiIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ApiSpecIterator ¶
type ApiSpecIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.ApiSpec, nextPageToken string, err error) // contains filtered or unexported fields }
ApiSpecIterator manages a stream of *rpcpb.ApiSpec.
func (*ApiSpecIterator) Next ¶
func (it *ApiSpecIterator) Next() (*rpcpb.ApiSpec, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ApiSpecIterator) PageInfo ¶
func (it *ApiSpecIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ApiVersionIterator ¶
type ApiVersionIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.ApiVersion, nextPageToken string, err error) // contains filtered or unexported fields }
ApiVersionIterator manages a stream of *rpcpb.ApiVersion.
func (*ApiVersionIterator) Next ¶
func (it *ApiVersionIterator) Next() (*rpcpb.ApiVersion, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ApiVersionIterator) PageInfo ¶
func (it *ApiVersionIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ArtifactIterator ¶
type ArtifactIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.Artifact, nextPageToken string, err error) // contains filtered or unexported fields }
ArtifactIterator manages a stream of *rpcpb.Artifact.
func (*ArtifactIterator) Next ¶
func (it *ArtifactIterator) Next() (*rpcpb.Artifact, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ArtifactIterator) PageInfo ¶
func (it *ArtifactIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ProjectIterator ¶
type ProjectIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*rpcpb.Project, nextPageToken string, err error) // contains filtered or unexported fields }
ProjectIterator manages a stream of *rpcpb.Project.
func (*ProjectIterator) Next ¶
func (it *ProjectIterator) Next() (*rpcpb.Project, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ProjectIterator) PageInfo ¶
func (it *ProjectIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RegistryCallOptions ¶
type RegistryCallOptions struct { GetStatus []gax.CallOption ListProjects []gax.CallOption GetProject []gax.CallOption CreateProject []gax.CallOption UpdateProject []gax.CallOption DeleteProject []gax.CallOption ListApis []gax.CallOption GetApi []gax.CallOption CreateApi []gax.CallOption UpdateApi []gax.CallOption DeleteApi []gax.CallOption ListApiVersions []gax.CallOption GetApiVersion []gax.CallOption CreateApiVersion []gax.CallOption UpdateApiVersion []gax.CallOption DeleteApiVersion []gax.CallOption ListApiSpecs []gax.CallOption GetApiSpec []gax.CallOption GetApiSpecContents []gax.CallOption CreateApiSpec []gax.CallOption UpdateApiSpec []gax.CallOption DeleteApiSpec []gax.CallOption TagApiSpecRevision []gax.CallOption ListApiSpecRevisions []gax.CallOption RollbackApiSpec []gax.CallOption DeleteApiSpecRevision []gax.CallOption ListArtifacts []gax.CallOption GetArtifact []gax.CallOption GetArtifactContents []gax.CallOption CreateArtifact []gax.CallOption ReplaceArtifact []gax.CallOption DeleteArtifact []gax.CallOption }
RegistryCallOptions contains the retry settings for each method of RegistryClient.
type RegistryClient ¶
type RegistryClient struct { // The call options for this service. CallOptions *RegistryCallOptions // contains filtered or unexported fields }
RegistryClient is a client for interacting with . Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Registry service allows teams to manage descriptions of APIs.
func NewRegistryClient ¶
func NewRegistryClient(ctx context.Context, opts ...option.ClientOption) (*RegistryClient, error)
NewRegistryClient creates a new registry client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
The Registry service allows teams to manage descriptions of APIs.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*RegistryClient) Close ¶
func (c *RegistryClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RegistryClient) Connection ¶
func (c *RegistryClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*RegistryClient) CreateApi ¶
func (c *RegistryClient) CreateApi(ctx context.Context, req *rpcpb.CreateApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
CreateApi createApi creates a specified API.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateApiRequest. } resp, err := c.CreateApi(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) CreateApiSpec ¶
func (c *RegistryClient) CreateApiSpec(ctx context.Context, req *rpcpb.CreateApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
CreateApiSpec createApiSpec creates a specified spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateApiSpecRequest. } resp, err := c.CreateApiSpec(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) CreateApiVersion ¶
func (c *RegistryClient) CreateApiVersion(ctx context.Context, req *rpcpb.CreateApiVersionRequest, opts ...gax.CallOption) (*rpcpb.ApiVersion, error)
CreateApiVersion createApiVersion creates a specified version.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateApiVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateApiVersionRequest. } resp, err := c.CreateApiVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) CreateArtifact ¶
func (c *RegistryClient) CreateArtifact(ctx context.Context, req *rpcpb.CreateArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
CreateArtifact createArtifact creates a specified artifact.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateArtifactRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateArtifactRequest. } resp, err := c.CreateArtifact(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) CreateProject ¶
func (c *RegistryClient) CreateProject(ctx context.Context, req *rpcpb.CreateProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
CreateProject createProject creates a specified project. (– api-linter: standard-methods=disabled –) (– api-linter: core::0133::http-uri-parent=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Project has an implicit parent. –) (– api-linter: core::0133::method-signature=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Project has an implicit parent. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.CreateProjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#CreateProjectRequest. } resp, err := c.CreateProject(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) DeleteApi ¶
func (c *RegistryClient) DeleteApi(ctx context.Context, req *rpcpb.DeleteApiRequest, opts ...gax.CallOption) error
DeleteApi deleteApi removes a specified API and all of the resources that it owns.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiRequest. } err = c.DeleteApi(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) DeleteApiSpec ¶
func (c *RegistryClient) DeleteApiSpec(ctx context.Context, req *rpcpb.DeleteApiSpecRequest, opts ...gax.CallOption) error
DeleteApiSpec deleteApiSpec removes a specified spec, all revisions, and all child resources (e.g. artifacts).
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiSpecRequest. } err = c.DeleteApiSpec(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) DeleteApiSpecRevision ¶
func (c *RegistryClient) DeleteApiSpecRevision(ctx context.Context, req *rpcpb.DeleteApiSpecRevisionRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
DeleteApiSpecRevision deleteApiSpecRevision deletes a revision of a spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiSpecRevisionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiSpecRevisionRequest. } resp, err := c.DeleteApiSpecRevision(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) DeleteApiVersion ¶
func (c *RegistryClient) DeleteApiVersion(ctx context.Context, req *rpcpb.DeleteApiVersionRequest, opts ...gax.CallOption) error
DeleteApiVersion deleteApiVersion removes a specified version and all of the resources that it owns.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteApiVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteApiVersionRequest. } err = c.DeleteApiVersion(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) DeleteArtifact ¶
func (c *RegistryClient) DeleteArtifact(ctx context.Context, req *rpcpb.DeleteArtifactRequest, opts ...gax.CallOption) error
DeleteArtifact deleteArtifact removes a specified artifact.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteArtifactRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteArtifactRequest. } err = c.DeleteArtifact(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) DeleteProject ¶
func (c *RegistryClient) DeleteProject(ctx context.Context, req *rpcpb.DeleteProjectRequest, opts ...gax.CallOption) error
DeleteProject deleteProject removes a specified project and all of the resources that it owns.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.DeleteProjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#DeleteProjectRequest. } err = c.DeleteProject(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*RegistryClient) GetApi ¶
func (c *RegistryClient) GetApi(ctx context.Context, req *rpcpb.GetApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
GetApi getApi returns a specified API.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiRequest. } resp, err := c.GetApi(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetApiSpec ¶
func (c *RegistryClient) GetApiSpec(ctx context.Context, req *rpcpb.GetApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
GetApiSpec getApiSpec returns a specified spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiSpecRequest. } resp, err := c.GetApiSpec(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetApiSpecContents ¶
func (c *RegistryClient) GetApiSpecContents(ctx context.Context, req *rpcpb.GetApiSpecContentsRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)
GetApiSpecContents getApiSpecContents returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned). (– api-linter: core::0131::response-message-name=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Responses are arbitrary blobs of data. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiSpecContentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiSpecContentsRequest. } resp, err := c.GetApiSpecContents(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetApiVersion ¶
func (c *RegistryClient) GetApiVersion(ctx context.Context, req *rpcpb.GetApiVersionRequest, opts ...gax.CallOption) (*rpcpb.ApiVersion, error)
GetApiVersion getApiVersion returns a specified version.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetApiVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetApiVersionRequest. } resp, err := c.GetApiVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetArtifact ¶
func (c *RegistryClient) GetArtifact(ctx context.Context, req *rpcpb.GetArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
GetArtifact getArtifact returns a specified artifact.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetArtifactRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetArtifactRequest. } resp, err := c.GetArtifact(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetArtifactContents ¶
func (c *RegistryClient) GetArtifactContents(ctx context.Context, req *rpcpb.GetArtifactContentsRequest, opts ...gax.CallOption) (*httpbodypb.HttpBody, error)
GetArtifactContents getArtifactContents returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned). (– api-linter: core::0131::response-message-name=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Responses are arbitrary blobs of data. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetArtifactContentsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetArtifactContentsRequest. } resp, err := c.GetArtifactContents(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetProject ¶
func (c *RegistryClient) GetProject(ctx context.Context, req *rpcpb.GetProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
GetProject getProject returns a specified project.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.GetProjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#GetProjectRequest. } resp, err := c.GetProject(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GetStatus ¶
func (c *RegistryClient) GetStatus(ctx context.Context, req *emptypb.Empty, opts ...gax.CallOption) (*rpcpb.Status, error)
GetStatus getStatus returns the status of the service. GetStatus is for verifying open source deployments only and is not included in hosted versions of the API. (– api-linter: core::0131::request-message-name=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –) (– api-linter: core::0131::method-signature=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –) (– api-linter: core::0131::http-uri-name=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): Not in the official API. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" emptypb "google.golang.org/protobuf/types/known/emptypb" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &emptypb.Empty{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/protobuf/types/known/emptypb#Empty. } resp, err := c.GetStatus(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) GrpcClient ¶
func (c *RegistryClient) GrpcClient() rpcpb.RegistryClient
func (*RegistryClient) ListApiSpecRevisions ¶
func (c *RegistryClient) ListApiSpecRevisions(ctx context.Context, req *rpcpb.ListApiSpecRevisionsRequest, opts ...gax.CallOption) *ApiSpecIterator
ListApiSpecRevisions listApiSpecRevisions lists all revisions of a spec. Revisions are returned in descending order of revision creation time.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApiSpecRevisionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApiSpecRevisionsRequest. } it := c.ListApiSpecRevisions(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListApiSpecs ¶
func (c *RegistryClient) ListApiSpecs(ctx context.Context, req *rpcpb.ListApiSpecsRequest, opts ...gax.CallOption) *ApiSpecIterator
ListApiSpecs listApiSpecs returns matching specs.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApiSpecsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApiSpecsRequest. } it := c.ListApiSpecs(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListApiVersions ¶
func (c *RegistryClient) ListApiVersions(ctx context.Context, req *rpcpb.ListApiVersionsRequest, opts ...gax.CallOption) *ApiVersionIterator
ListApiVersions listApiVersions returns matching versions.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApiVersionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApiVersionsRequest. } it := c.ListApiVersions(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListApis ¶
func (c *RegistryClient) ListApis(ctx context.Context, req *rpcpb.ListApisRequest, opts ...gax.CallOption) *ApiIterator
ListApis listApis returns matching APIs.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListApisRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListApisRequest. } it := c.ListApis(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListArtifacts ¶
func (c *RegistryClient) ListArtifacts(ctx context.Context, req *rpcpb.ListArtifactsRequest, opts ...gax.CallOption) *ArtifactIterator
ListArtifacts listArtifacts returns matching artifacts.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListArtifactsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListArtifactsRequest. } it := c.ListArtifacts(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ListProjects ¶
func (c *RegistryClient) ListProjects(ctx context.Context, req *rpcpb.ListProjectsRequest, opts ...gax.CallOption) *ProjectIterator
ListProjects listProjects returns matching projects. (– api-linter: standard-methods=disabled –) (– api-linter: core::0132::method-signature=disabled aip.dev/not-precedent (at http://aip.dev/not-precedent): projects are top-level resources. –)
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ListProjectsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ListProjectsRequest. } it := c.ListProjects(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*RegistryClient) ReplaceArtifact ¶
func (c *RegistryClient) ReplaceArtifact(ctx context.Context, req *rpcpb.ReplaceArtifactRequest, opts ...gax.CallOption) (*rpcpb.Artifact, error)
ReplaceArtifact replaceArtifact can be used to replace a specified artifact.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.ReplaceArtifactRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#ReplaceArtifactRequest. } resp, err := c.ReplaceArtifact(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) RollbackApiSpec ¶
func (c *RegistryClient) RollbackApiSpec(ctx context.Context, req *rpcpb.RollbackApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
RollbackApiSpec rollbackApiSpec sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.RollbackApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#RollbackApiSpecRequest. } resp, err := c.RollbackApiSpec(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) TagApiSpecRevision ¶
func (c *RegistryClient) TagApiSpecRevision(ctx context.Context, req *rpcpb.TagApiSpecRevisionRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
TagApiSpecRevision tagApiSpecRevision adds a tag to a specified revision of a spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.TagApiSpecRevisionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#TagApiSpecRevisionRequest. } resp, err := c.TagApiSpecRevision(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) UpdateApi ¶
func (c *RegistryClient) UpdateApi(ctx context.Context, req *rpcpb.UpdateApiRequest, opts ...gax.CallOption) (*rpcpb.Api, error)
UpdateApi updateApi can be used to modify a specified API.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateApiRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateApiRequest. } resp, err := c.UpdateApi(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) UpdateApiSpec ¶
func (c *RegistryClient) UpdateApiSpec(ctx context.Context, req *rpcpb.UpdateApiSpecRequest, opts ...gax.CallOption) (*rpcpb.ApiSpec, error)
UpdateApiSpec updateApiSpec can be used to modify a specified spec.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateApiSpecRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateApiSpecRequest. } resp, err := c.UpdateApiSpec(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) UpdateApiVersion ¶
func (c *RegistryClient) UpdateApiVersion(ctx context.Context, req *rpcpb.UpdateApiVersionRequest, opts ...gax.CallOption) (*rpcpb.ApiVersion, error)
UpdateApiVersion updateApiVersion can be used to modify a specified version.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateApiVersionRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateApiVersionRequest. } resp, err := c.UpdateApiVersion(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*RegistryClient) UpdateProject ¶
func (c *RegistryClient) UpdateProject(ctx context.Context, req *rpcpb.UpdateProjectRequest, opts ...gax.CallOption) (*rpcpb.Project, error)
UpdateProject updateProject can be used to modify a specified project.
Example ¶
package main import ( "context" gapic "github.com/apigee/registry/gapic" rpcpb "github.com/apigee/registry/rpc" ) func main() { ctx := context.Background() c, err := gapic.NewRegistryClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rpcpb.UpdateProjectRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/github.com/apigee/registry/rpc#UpdateProjectRequest. } resp, err := c.UpdateProject(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output: