Documentation ¶
Overview ¶
Package base provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.
Index ¶
- Variables
- func AddPeriod(t time.Time, p Period) time.Timedeprecated
- func ExtractGraphODataErrorCode(err error) (errorCode *string, odErr *odataerrors.ODataError, ok bool)
- func HandleAzCosmosError(err error) error
- func HandleAzKeyVaultError(err error) error
- func HandleResponseError(next echo.HandlerFunc) echo.HandlerFunc
- func NewAzCosmosCRUDDocService(client *azcosmos.ContainerClient) *azcosmosContainerCRUDDocService
- func ParseIdentifier(s string) (i identifier)
- func RespondDiagnostics(c ctx.RequestContext, info models.ServiceRuntimeInfo) error
- func RespondHealthCheck(c echo.Context) error
- func StringIdentifier(id string) identifier
- type AzCosmosCRUDDocService
- type AzureRoleAssignment
- type AzureRoleAssignmentResponse
- type Base64RawURLEncodedBytes
- type BaseDoc
- func (d *BaseDoc) GetID() ID
- func (d *BaseDoc) GetStorageFullIdentifier() DocLocator
- func (d *BaseDoc) GetStorageNamespaceID() DocNamespacePartitionKey
- func (d *BaseDoc) GetUpdatedBy() string
- func (d *BaseDoc) Init(nsKind NamespaceKind, nsID ID, rKind ResourceKind, rID ID)
- func (d *BaseDoc) PopulateModelRef(m *ResourceReference)
- type BaseDocument
- type BaseServer
- type ContextKey
- type CosmosQueryBuilder
- func (b *CosmosQueryBuilder) BuildQuery() (string, []azcosmos.QueryParameter)
- func (b *CosmosQueryBuilder) WithExtraColumns(columns ...string) *CosmosQueryBuilder
- func (b *CosmosQueryBuilder) WithOffsetLimit(offset uint, limit uint) *CosmosQueryBuilder
- func (b *CosmosQueryBuilder) WithOrderBy(clause string) *CosmosQueryBuilder
- func (b *CosmosQueryBuilder) WithWhereClauses(clauses ...string) *CosmosQueryBuilder
- type DocLocator
- func (i DocLocator) ID() ID
- func (i DocLocator) MarshalText() (text []byte, err error)
- func (i DocLocator) NamespaceID() ID
- func (i DocLocator) NamespaceKind() NamespaceKind
- func (i DocLocator) PartitionKey() DocNamespacePartitionKey
- func (i DocLocator) String() string
- func (p *DocLocator) UnmarshalText(text []byte) error
- type DocNamespacePartitionKey
- type DocPager
- type HexDigest
- type HttpResponseError
- type ID
- type Id
- type ListAzureRoleAssignmentsResponse
- type ModelPopulater
- type ModelRefPopulater
- type NamespaceConfigName
- type NamespaceIdParameter
- type NamespaceIdentifier
- type NamespaceKind
- type NamespaceKindParameter
- type NumericDate
- type Period
- type QueryBaseDoc
- type QueryDocument
- type ResourceIdParameter
- type ResourceKind
- type ResourceLocator
- type ResourceReference
- type ResourceReferenceListResponse
- type UUID
Constants ¶
This section is empty.
Variables ¶
var ( ErrAzCosmosDocNotFound = errors.New("az cosmos doc not found") ErrAzKeyVaultItemNotFound = errors.New("az key vault key not found") ErrResponseStatusBadRequest = httpResposneError(http.StatusBadRequest, "bad request") ErrResponseStatusForbidden = httpResposneError(http.StatusForbidden, "forbidden") ErrResponseStatusNotFound = httpResposneError(http.StatusNotFound, "not found") ErrResponseStatusTooManyRequests = httpResposneError(http.StatusTooManyRequests, "conflict") )
Functions ¶
func ExtractGraphODataErrorCode ¶
func ExtractGraphODataErrorCode(err error) (errorCode *string, odErr *odataerrors.ODataError, ok bool)
func HandleAzCosmosError ¶
func HandleAzKeyVaultError ¶
func HandleResponseError ¶
func HandleResponseError(next echo.HandlerFunc) echo.HandlerFunc
func NewAzCosmosCRUDDocService ¶
func NewAzCosmosCRUDDocService(client *azcosmos.ContainerClient) *azcosmosContainerCRUDDocService
func ParseIdentifier ¶
func ParseIdentifier(s string) (i identifier)
func RespondDiagnostics ¶
func RespondDiagnostics(c ctx.RequestContext, info models.ServiceRuntimeInfo) error
func RespondHealthCheck ¶
func RespondHealthCheck(c echo.Context) error
func StringIdentifier ¶
func StringIdentifier(id string) identifier
Types ¶
type AzCosmosCRUDDocService ¶
type AzCosmosCRUDDocService interface { Create(context.Context, BaseDocument, *azcosmos.ItemOptions) error Upsert(context.Context, BaseDocument, *azcosmos.ItemOptions) error Read(c context.Context, docFullIdentifier DocLocator, dst BaseDocument, opts *azcosmos.ItemOptions) error Patch(context.Context, BaseDocument, azcosmos.PatchOperations, *azcosmos.ItemOptions) error NewQueryItemsPager(query string, storageNamespaceID DocNamespacePartitionKey, o *azcosmos.QueryOptions) *azruntime.Pager[azcosmos.QueryItemsResponse] SoftDelete(c context.Context, doc BaseDocument, opts *azcosmos.ItemOptions) error Delete(c context.Context, doc BaseDocument, opts *azcosmos.ItemOptions) error // contains filtered or unexported methods }
func GetAzCosmosCRUDService ¶
func GetAzCosmosCRUDService(c context.Context) AzCosmosCRUDDocService
type AzureRoleAssignment ¶
type AzureRoleAssignment struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` PrincipalId *string `json:"principalId,omitempty"` RoleDefinitionId *string `json:"roleDefinitionId,omitempty"` }
AzureRoleAssignment defines model for AzureRoleAssignment.
type AzureRoleAssignmentResponse ¶
type AzureRoleAssignmentResponse = AzureRoleAssignment
AzureRoleAssignmentResponse defines model for AzureRoleAssignmentResponse.
type Base64RawURLEncodedBytes ¶
type Base64RawURLEncodedBytes = cloudkey.Base64RawURLEncodableBytes
Base64RawURLEncodedBytes defines model for Base64RawURLEncodedBytes.
type BaseDoc ¶
type BaseDoc struct { PartitionKey DocNamespacePartitionKey `json:"namespaceId"` ID ID `json:"id"` Timestamp *jwt.NumericDate `json:"_ts,omitempty"` ETag *azcore.ETag `json:"_etag,omitempty"` Deleted *time.Time `json:"deleted,omitempty"` UpdatedBy string `json:"updatedBy,omitempty"` }
func (*BaseDoc) GetStorageFullIdentifier ¶
func (d *BaseDoc) GetStorageFullIdentifier() DocLocator
GetPersistedSLocator implements CRUDDoc.
func (*BaseDoc) GetStorageNamespaceID ¶
func (d *BaseDoc) GetStorageNamespaceID() DocNamespacePartitionKey
func (*BaseDoc) GetUpdatedBy ¶
GetUpdatedBy implements CRUDDoc.
func (*BaseDoc) Init ¶
func (d *BaseDoc) Init(nsKind NamespaceKind, nsID ID, rKind ResourceKind, rID ID)
func (*BaseDoc) PopulateModelRef ¶
func (d *BaseDoc) PopulateModelRef(m *ResourceReference)
PopulateModelRef implements ModelRefPopulater.
type BaseDocument ¶
type BaseDocument interface { GetStorageNamespaceID() DocNamespacePartitionKey GetID() ID GetStorageFullIdentifier() DocLocator GetUpdatedBy() string // contains filtered or unexported methods }
type BaseServer ¶
type BaseServer struct {
common.CommonServer
}
func NewBaseServer ¶
func NewBaseServer(server common.CommonServer) *BaseServer
NewBaseServer creates a new base server.
func (*BaseServer) GetDiagnostics ¶
func (s *BaseServer) GetDiagnostics(ec echo.Context) error
GetDiagnostics implements ServerInterface.
type CosmosQueryBuilder ¶
type CosmosQueryBuilder struct { Columns []string WhereClauses []string OrderBy string Parameters []azcosmos.QueryParameter OffsetLimitClause string }
func NewDefaultCosmoQueryBuilder ¶
func NewDefaultCosmoQueryBuilder() *CosmosQueryBuilder
func (*CosmosQueryBuilder) BuildQuery ¶
func (b *CosmosQueryBuilder) BuildQuery() (string, []azcosmos.QueryParameter)
func (*CosmosQueryBuilder) WithExtraColumns ¶
func (b *CosmosQueryBuilder) WithExtraColumns(columns ...string) *CosmosQueryBuilder
func (*CosmosQueryBuilder) WithOffsetLimit ¶
func (b *CosmosQueryBuilder) WithOffsetLimit(offset uint, limit uint) *CosmosQueryBuilder
func (*CosmosQueryBuilder) WithOrderBy ¶
func (b *CosmosQueryBuilder) WithOrderBy(clause string) *CosmosQueryBuilder
func (*CosmosQueryBuilder) WithWhereClauses ¶
func (b *CosmosQueryBuilder) WithWhereClauses(clauses ...string) *CosmosQueryBuilder
type DocLocator ¶
type DocLocator struct {
// contains filtered or unexported fields
}
func NewDocLocator ¶
func NewDocLocator(nsKind NamespaceKind, nsID ID, rKind ResourceKind, rID ID) DocLocator
func (DocLocator) ID ¶
func (i DocLocator) ID() ID
func (DocLocator) MarshalText ¶
func (i DocLocator) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler.
func (DocLocator) NamespaceID ¶
func (i DocLocator) NamespaceID() ID
func (DocLocator) NamespaceKind ¶
func (i DocLocator) NamespaceKind() NamespaceKind
func (DocLocator) PartitionKey ¶
func (i DocLocator) PartitionKey() DocNamespacePartitionKey
func (DocLocator) String ¶
func (i DocLocator) String() string
func (*DocLocator) UnmarshalText ¶
func (p *DocLocator) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type DocNamespacePartitionKey ¶
type DocNamespacePartitionKey struct {
// contains filtered or unexported fields
}
func NewDocNamespacePartitionKey ¶
func NewDocNamespacePartitionKey(nsKind NamespaceKind, nsID ID, rKind ResourceKind) DocNamespacePartitionKey
func (DocNamespacePartitionKey) MarshalText ¶
func (i DocNamespacePartitionKey) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler.
func (DocNamespacePartitionKey) String ¶
func (i DocNamespacePartitionKey) String() string
func (*DocNamespacePartitionKey) UnmarshalText ¶
func (p *DocNamespacePartitionKey) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type DocPager ¶
type DocPager[D QueryDocument] struct { // contains filtered or unexported fields }
func NewQueryDocPager ¶
func NewQueryDocPager[D QueryDocument](c context.Context, queryBuilder *CosmosQueryBuilder, storageNamespaceID DocNamespacePartitionKey) *DocPager[D]
func ToDocPager ¶
func ToDocPager[D QueryDocument](pager *azruntime.Pager[azcosmos.QueryItemsResponse]) *DocPager[D]
type HexDigest ¶
type HexDigest []byte
func (HexDigest) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*HexDigest) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type HttpResponseError ¶
type HttpResponseError struct { StatusCode int // contains filtered or unexported fields }
type ID ¶
type ID string
func IDFromString ¶
func IDFromUUID ¶
func (ID) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*ID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type ListAzureRoleAssignmentsResponse ¶
type ListAzureRoleAssignmentsResponse = []AzureRoleAssignment
ListAzureRoleAssignmentsResponse defines model for ListAzureRoleAssignmentsResponse.
type ModelPopulater ¶
type ModelPopulater[M any] interface { PopulateModel(*M) }
type ModelRefPopulater ¶
type ModelRefPopulater[M any] interface { PopulateModelRef(*M) }
type NamespaceConfigName ¶
type NamespaceConfigName string
const ( CertRuleNameIssuer NamespaceConfigName = "issuer" CertRuleNameMsEntraClientCredential NamespaceConfigName = "ms-entra-client-credential" AgentConfigNameServer NamespaceConfigName = "agent-server" AgentConfigNameRadius NamespaceConfigName = "radius" )
type NamespaceIdParameter ¶
type NamespaceIdParameter = Id
NamespaceIdParameter defines model for NamespaceIdParameter.
type NamespaceIdentifier ¶
type NamespaceIdentifier struct {
// contains filtered or unexported fields
}
func NewNamespaceIdentifier ¶
func NewNamespaceIdentifier(nsKind NamespaceKind, nsID ID) NamespaceIdentifier
func (NamespaceIdentifier) ID ¶
func (i NamespaceIdentifier) ID() ID
func (NamespaceIdentifier) Kind ¶
func (i NamespaceIdentifier) Kind() NamespaceKind
func (NamespaceIdentifier) MarshalText ¶
func (i NamespaceIdentifier) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler.
func (NamespaceIdentifier) String ¶
func (i NamespaceIdentifier) String() string
func (*NamespaceIdentifier) UnmarshalText ¶
func (p *NamespaceIdentifier) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type NamespaceKind ¶
type NamespaceKind string
NamespaceKind defines model for NamespaceKind.
const ( NamespaceKindGroup NamespaceKind = "group" NamespaceKindIntermediateCA NamespaceKind = "int-ca" NamespaceKindProfile NamespaceKind = "profile" NamespaceKindRootCA NamespaceKind = "root-ca" NamespaceKindServicePrincipal NamespaceKind = "service-principal" NamespaceKindSystem NamespaceKind = "sys" NamespaceKindUser NamespaceKind = "user" )
Defines values for NamespaceKind.
type NamespaceKindParameter ¶
type NamespaceKindParameter = NamespaceKind
NamespaceKindParameter defines model for NamespaceKindParameter.
type QueryBaseDoc ¶
type QueryBaseDoc struct { ID ID `json:"id"` Timestamp jwt.NumericDate `json:"_ts"` Deleted *time.Time `json:"deleted"` }
func (*QueryBaseDoc) PopulateModelRef ¶
func (d *QueryBaseDoc) PopulateModelRef(r *ResourceReference)
PopulateModelRef implements ModelRefPopulater.
type QueryDocument ¶
type QueryDocument interface {
GetID() ID
}
type ResourceIdParameter ¶
type ResourceIdParameter = Id
ResourceIdParameter defines model for ResourceIdParameter.
type ResourceKind ¶
type ResourceKind string
ResourceKind defines model for ResourceKind.
const ( ProfileResourceKindGroup ResourceKind = "group" ProfileResourceKindIntermediateCA ResourceKind = "int-ca" ProfileResourceKindManagedApp ResourceKind = "managed-app" ProfileResourceKindRootCA ResourceKind = "root-ca" ProfileResourceKindServicePrincipal ResourceKind = "service-principal" ProfileResourceKindUser ResourceKind = "user" ResourceKindAgentInstance ResourceKind = "agent-instance" ResourceKindCert ResourceKind = "cert" ResourceKindCertPolicy ResourceKind = "cert-policy" ResourceKindKey ResourceKind = "key" ResourceKindKeyPolicy ResourceKind = "key-policy" ResourceKindNamespaceConfig ResourceKind = "ns-config" ResourceKindSecret ResourceKind = "secret" ResourceKindSecretPolicy ResourceKind = "secret-policy" )
Defines values for ResourceKind.
type ResourceLocator ¶
type ResourceLocator = DocLocator
ResourceLocator defines model for ResourceLocator.
type ResourceReference ¶
type ResourceReference struct { Deleted *time.Time `json:"deleted,omitempty"` ID ID `json:"id"` Updated time.Time `json:"updated"` UpdatedBy *string `json:"updatedBy,omitempty"` }
ResourceReference defines model for ResourceReference.
type ResourceReferenceListResponse ¶
type ResourceReferenceListResponse = []ResourceReference
ResourceReferenceListResponse defines model for ResourceReferenceListResponse.