iamexample

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package iamexample provides a reference implementation of a gRPC service that uses IAM for access management.

Index

Constants

View Source
const MemberHeader = "x-iam-example-members"

MemberHeader is the gRPC header used by the example server to determine IAM members of the caller.

Variables

This section is empty.

Functions

func NewMemberHeaderResolver added in v0.2.0

func NewMemberHeaderResolver() iamcaller.Resolver

NewMemberHeaderResolver returns an iammember.Resolver that resolves members from MemberHeader.

func SQLSchema added in v0.4.0

func SQLSchema() string

SQLSchema returns the example Spanner SQL schema.

func WithOutgoingMembers added in v0.2.0

func WithOutgoingMembers(ctx context.Context, members ...string) context.Context

WithOutgoingMembers appends the provided members to the outgoing gRPC context.

Types

type Config

type Config struct {
	ErrorHook func(context.Context, error)
}

Config for a Server.

type Server

type Server struct {
	IAM     *iamspanner.IAMServer
	Spanner *spanner.Client
	Config  Config
}

Server implements iamexamplev1.FreightServiceServer.

func (*Server) BatchGetShipments

BatchGetShipments implements iamexamplev1.FreightServiceServer.

func (*Server) BatchGetSites

BatchGetSites implements iamexamplev1.FreightServiceServer.

func (*Server) CancelOperation added in v0.18.0

func (s *Server) CancelOperation(
	ctx context.Context,
	request *longrunning.CancelOperationRequest,
) (*emptypb.Empty, error)

CancelOperation implements longrunning.OperationsServer.

func (*Server) CreateShipment

func (s *Server) CreateShipment(
	ctx context.Context,
	request *iamexamplev1.CreateShipmentRequest,
) (*iamexamplev1.Shipment, error)

func (*Server) CreateShipper

func (s *Server) CreateShipper(
	ctx context.Context,
	request *iamexamplev1.CreateShipperRequest,
) (*iamexamplev1.Shipper, error)

CreateShipper implements iamexamplev1.FreightServiceServer.

func (*Server) CreateSite

func (s *Server) CreateSite(
	ctx context.Context,
	request *iamexamplev1.CreateSiteRequest,
) (*iamexamplev1.Site, error)

CreateSite implements iamexamplev1.FreightServiceServer.

func (*Server) DeleteOperation added in v0.18.0

func (s *Server) DeleteOperation(
	ctx context.Context,
	request *longrunning.DeleteOperationRequest,
) (*emptypb.Empty, error)

DeleteOperation implements longrunning.OperationsServer.

func (*Server) DeleteShipment

func (s *Server) DeleteShipment(
	ctx context.Context,
	request *iamexamplev1.DeleteShipmentRequest,
) (*iamexamplev1.Shipment, error)

DeleteShipment implements iamexamplev1.FreightServiceServer.

func (*Server) DeleteShipper

func (s *Server) DeleteShipper(
	ctx context.Context,
	request *iamexamplev1.DeleteShipperRequest,
) (*longrunning.Operation, error)

DeleteShipper implements iamexamplev1.FreightServiceServer.

func (*Server) DeleteSite

func (s *Server) DeleteSite(
	ctx context.Context,
	request *iamexamplev1.DeleteSiteRequest,
) (*iamexamplev1.Site, error)

DeleteSite implements iamexamplev1.FreightServiceServer.

func (*Server) GetIamPolicy

func (s *Server) GetIamPolicy(
	ctx context.Context,
	request *iam.GetIamPolicyRequest,
) (*iam.Policy, error)

GetIamPolicy implements iam.IAMPolicyServer.

func (*Server) GetOperation added in v0.18.0

func (s *Server) GetOperation(
	ctx context.Context,
	request *longrunning.GetOperationRequest,
) (*longrunning.Operation, error)

GetOperation implements longrunning.OperationsServer.

func (*Server) GetRole added in v0.21.0

func (s *Server) GetRole(
	ctx context.Context,
	request *admin.GetRoleRequest,
) (*admin.Role, error)

GetRole implements admin.IAMServer.

func (*Server) GetShipment

func (s *Server) GetShipment(
	ctx context.Context,
	request *iamexamplev1.GetShipmentRequest,
) (*iamexamplev1.Shipment, error)

GetShipment implements iamexamplev1.FreightServiceServer.

func (*Server) GetShipper

func (s *Server) GetShipper(
	ctx context.Context,
	request *iamexamplev1.GetShipperRequest,
) (*iamexamplev1.Shipper, error)

GetShipper implements iamexamplev1.FreightServiceServer.

func (*Server) GetSite

func (s *Server) GetSite(
	ctx context.Context,
	request *iamexamplev1.GetSiteRequest,
) (*iamexamplev1.Site, error)

GetSite implements iamexamplev1.FreightServiceServer.

func (*Server) ListOperations added in v0.18.0

ListOperations implements longrunning.OperationsServer.

func (*Server) ListRoles added in v0.16.0

func (s *Server) ListRoles(
	ctx context.Context,
	request *admin.ListRolesRequest,
) (*admin.ListRolesResponse, error)

ListRoles implements admin.IAMServer.

func (*Server) ListShipments

ListShipments implements iamexamplev1.FreightServiceServer.

func (*Server) ListShippers

ListShippers implements iamexamplev1.FreightServiceServer.

func (*Server) ListSites

ListSites implements iamexamplev1.FreightServiceServer.

func (*Server) SearchSites

func (*Server) SetIamPolicy

func (s *Server) SetIamPolicy(
	ctx context.Context,
	request *iam.SetIamPolicyRequest,
) (*iam.Policy, error)

SetIamPolicy implements iam.IAMPolicyServer.

func (*Server) TestIamPermissions

func (s *Server) TestIamPermissions(
	ctx context.Context,
	request *iam.TestIamPermissionsRequest,
) (*iam.TestIamPermissionsResponse, error)

TestIamPermissions implements iam.IAMPolicyServer.

func (*Server) UpdateShipment

func (s *Server) UpdateShipment(
	ctx context.Context,
	request *iamexamplev1.UpdateShipmentRequest,
) (*iamexamplev1.Shipment, error)

UpdateShipment implements iamexamplev1.FreightServiceServer.

func (*Server) UpdateShipper

func (s *Server) UpdateShipper(
	ctx context.Context,
	request *iamexamplev1.UpdateShipperRequest,
) (*iamexamplev1.Shipper, error)

UpdateShipper implements iamexamplev1.FreightServiceServer.

func (*Server) UpdateSite

func (s *Server) UpdateSite(
	ctx context.Context,
	request *iamexamplev1.UpdateSiteRequest,
) (*iamexamplev1.Site, error)

UpdateSite implements iamexamplev1.FreightServiceServer.

func (*Server) WaitOperation added in v0.18.0

func (s *Server) WaitOperation(
	ctx context.Context,
	request *longrunning.WaitOperationRequest,
) (*longrunning.Operation, error)

WaitOperation implements longrunning.OperationsServer.

Directories

Path Synopsis
Package iamexampledata provides predefined example data for the IAM example service.
Package iamexampledata provides predefined example data for the IAM example service.

Jump to

Keyboard shortcuts

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