iamexample

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

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 NewIAMMemberHeaderResolver added in v0.3.0

func NewIAMMemberHeaderResolver() iammember.Resolver

NewIAMMemberHeaderResolver 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 Authorization

type Authorization struct {
	iam.UnimplementedIAMPolicyServer
	admin.UnimplementedIAMServer
	Next iamexamplev1.FreightServiceServer
	IAM  *iamspanner.Server
}

func (*Authorization) BatchGetShipments

func (*Authorization) BatchGetSites

func (*Authorization) CreateShipment

func (*Authorization) CreateShipper

func (*Authorization) CreateSite

func (a *Authorization) CreateSite(
	ctx context.Context,
	request *iamexamplev1.CreateSiteRequest,
) (*iamexamplev1.Site, error)

func (*Authorization) DeleteShipment

func (*Authorization) DeleteShipper

func (*Authorization) DeleteSite

func (a *Authorization) DeleteSite(
	ctx context.Context,
	request *iamexamplev1.DeleteSiteRequest,
) (*iamexamplev1.Site, error)

func (*Authorization) GetIamPolicy

func (a *Authorization) GetIamPolicy(
	ctx context.Context,
	request *iam.GetIamPolicyRequest,
) (*iam.Policy, error)

func (*Authorization) GetShipment

func (*Authorization) GetShipper

func (*Authorization) GetSite

func (*Authorization) ListShipments

func (*Authorization) ListShippers

func (*Authorization) ListSites

func (*Authorization) SearchSites

func (*Authorization) SetIamPolicy

func (a *Authorization) SetIamPolicy(
	ctx context.Context,
	request *iam.SetIamPolicyRequest,
) (*iam.Policy, error)

func (*Authorization) TestIamPermissions

func (a *Authorization) TestIamPermissions(
	ctx context.Context,
	request *iam.TestIamPermissionsRequest,
) (*iam.TestIamPermissionsResponse, error)

func (*Authorization) UpdateShipment

func (*Authorization) UpdateShipper

func (*Authorization) UpdateSite

func (a *Authorization) UpdateSite(
	ctx context.Context,
	request *iamexamplev1.UpdateSiteRequest,
) (*iamexamplev1.Site, error)

type Config

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

Config for a Server.

type Server

type Server struct {
	IAM     *iamspanner.Server
	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) 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) 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,
) (*iamexamplev1.Shipper, 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) 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) 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.

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