NAME

OpenTracing::Types - Type constraints for checking Interfaces

SYNOPSIS

use OpenTracing::Types qw/Span/;
#
# imports the 'Span' Type

use Types::Standard qw/Maybe/;
use Types::Common::Numeric qw/PositiveOrZeroNum/;

use Function::Parameters;
use Function::Return;

# create a subroutine with some fancy type checks
#
sub time_gap (Span $span1, Span $span2) :Return Maybe[PositiveOrZeroNum] {
    return unless $span1->finish_time and $span2->start_time;
    return $span2->start_time - $span1->finish_time
}

DESCRIPTION

This library of Type::Tiny type constraints provide Duck Type checks for all common elements that conform OpenTracing::Interface

See "Export" in Type::Library about the various ways to import types an related methods.

TYPES

The following Duck Types are being defined with the mentioned required methods:

ContextReference

new_child_of
new_follows_from
get_referenced_context
type_is_child_of
type_is_follows_from

See also "INSTANCE METHODS" in OpenTracing::Interface::ContextReference and "CONSTRUCTOR METHODS" in OpenTracing::Interface::ContextReference.

Scope

close
get_span

See also "INSTANCE METHODS" in OpenTracing::Interface::Scope.

ScopeManager

activate_span
get_active_scope

See also "INSTANCE METHODS" in OpenTracing::Interface::ScopeManager.

Span

get_context
overwrite_operation_name
finish
set_tag
log_data
add_baggage_item
get_baggage_item

See also "INSTANCE METHODS" in OpenTracing::Interface::Span.

SpanContext

get_baggage_item
with_baggage_item

See also "INSTANCE METHODS" in OpenTracing::Interface::SpanContext.

Tracer

get_scope_manager
get_active_span
start_active_span
start_span
inject_context
extract_context

See also "INSTANCE METHODS" in OpenTracing::Interface::Tracer.

AUTHOR

Theo van Hoesel <tvanhoesel@perceptyx.com>

COPYRIGHT AND LICENSE

'OpenTracing Types' is Copyright (C) 2020 .. 2021, Perceptyx Inc

This library is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

This library is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties.

For details, see the full text of the license in the file LICENSE.